Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Thread.pass
() -> untyped
Thread.pass → nil
thread.c
View on GitHub ↗
static VALUE
thread_s_pass(VALUE klass)
{
rb_thread_schedule();
return Qnil;
}
Give the thread scheduler a hint to pass execution to another thread. A running thread may or may not switch, it depends on OS and processor.
See also
.new
.pending_interrupt?
.main
.report_on_exception
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0