rb_thread_lock_native_thread()

Introduce `rb_thread_lock_native_thread()` to allocate dedicated
native thread to the current Ruby thread for M:N threads.
This C API is similar to Go's `runtime.LockOSThread()`.

Accepted at https://github.com/ruby/dev-meeting-log/blob/master/2023/DevMeeting-2023-08-24.md
(and missed to implement on Ruby 3.3.0)
This commit is contained in:
Koichi Sasada 2024-02-20 19:09:23 +09:00
parent 91cb303531
commit d578684989
8 changed files with 165 additions and 14 deletions

View file

@ -1003,4 +1003,10 @@ rb_ractor_sched_barrier_join(rb_vm_t *vm, rb_ractor_t *cr)
vm->ractor.sync.lock_owner = NULL;
}
bool
rb_thread_lock_native_thread(void)
{
return false;
}
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */