instance method
Thread#alive?
() -> bool
thr.alive? → true or false
thread.c
View on GitHub ↗
static VALUE
rb_thread_alive_p(VALUE thread)
{
return RBOOL(!thread_finished(rb_thread_ptr(thread)));
}
Returns true if thr is running or sleeping.
Example
thr = Thread.new { } thr.join #=> #<Thread:0x401b3fb0 dead> Thread.current.alive? #=> true thr.alive? #=> false
See also
#add_trace_func
#backtrace
#abort_on_exception=
#backtrace_locations
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0