Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Thread.fork
(*untyped args) -> untyped
Thread.start([args]*) {|args| block } → thread
Thread.fork([args]*) {|args| block } → thread
thread.c
View on GitHub ↗
static VALUE
thread_start(VALUE klass, VALUE args)
{
struct thread_create_params params = {
.type = thread_invoke_type_proc,
.args = args,
.proc = rb_block_proc(),
};
return thread_create_core(rb_thread_alloc(klass), ¶ms);
}
Basically the same as ::new. However, if class Thread is subclassed, then calling start in that subclass will not invoke the subclass’s initialize method.
See also
.exit
.handle_interrupt
.each_caller_location
.ignore_deadlock
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0