Skip to content
instance method

Thread#value

() -> untyped
thr.value → obj

Waits for thr to complete, using join, and returns its value or raises the exception which terminated the thread.

Example
a = Thread.new { 2 + 2 }
a.value   #=> 4

b = Thread.new { raise 'something went wrong' }
b.value   #=> RuntimeError: something went wrong
See also #to_s #wakeup #thread_variable_set also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0