value()
  public
  
    
    
Waits for thr to complete, using #join, and returns its value or raises the exception which
terminated the thread.
a = Thread.new { 2 + 2 }
a.value   
b = Thread.new { raise 'something went wrong' }
b.value   
   
  
    Show source    
    
      static VALUE
thread_value(VALUE self)
{
    rb_thread_t *th = rb_thread_ptr(self);
    thread_join(th, DELAY_INFTY);
    return th->value;
}