Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Thread#stop?

thr.stop? → true or false

Returns true if thr is dead or sleeping.

Example
a = Thread.new { Thread.stop }
b = Thread.current
a.stop?   #=> true
b.stop?   #=> false

See also alive? and status.

See also .stop #status #terminate #set_trace_func also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0