class method
Thread.stop
() -> untyped
Thread.stop → nil
thread.c
View on GitHub ↗
static VALUE
thread_stop(VALUE _)
{
return rb_thread_stop();
}
Stops execution of the current thread, putting it into a “sleep” state, and schedules execution of another thread.
Example
a = Thread.new { print "a"; Thread.stop; print "c" } sleep 0.1 while a.status!='sleep' print "b" a.run a.join #=> "abc"