summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2024-02-20 19:09:23 +0900
committerKoichi Sasada <[email protected]>2024-02-21 15:38:29 +0900
commitd578684989fd2d75f086a259719e3eb0fe57ccb2 ()
tree182d720a6c0a63a7bcc1f6c48c276d082d074c05 /thread_pthread.c
parent91cb30353178004ba57acacf1c39d9c02beff86e (diff)
`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://.com/ruby/dev-meeting-log/blob/master/2023/DevMeeting-2023-08-24.md (and missed to implement on Ruby 3.3.0)
-rw-r--r--thread_pthread.c17
1 files changed, 17 insertions, 0 deletions
@@ -2304,6 +2304,11 @@ nt_start(void *ptr)
// timeout -> deleted.
break;
}
}
}
@@ -3422,4 +3427,16 @@ rb_thread_execute_hooks(rb_event_flag_t event, rb_thread_t *th)
}
}
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */