value()
public
Waits for thr to complete (via Thread#join) and returns
its value.
a = Thread.new { 2 + 2 }
a.value
Show source
/*
* call-seq:
* thr.value => obj
*
* Waits for <i>thr</i> to complete (via <code>Thread
* its value.
*
* a = Thread.new { 2 + 2 }
* a.value
*/
static VALUE
rb_thread_value(thread)
VALUE thread;
{
rb_thread_t th = rb_thread_check(thread);
while (!rb_thread_join(th, DELAY_INFTY));
return th->result;
}