Skip to content
class method

Thread.stop

() -> untyped
Thread.stop → nil

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"
See also #stop? .start #[] .report_on_exception= also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0