diff options
Diffstat (limited to 'include/ruby')
| -rw-r--r-- | include/ruby/thread.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/ruby/thread.h b/include/ruby/thread.h index f01d276a29..337f477fd0 100644 --- a/include/ruby/thread.h +++ b/include/ruby/thread.h @@ -191,6 +191,19 @@ void *rb_nogvl(void *(*func)(void *), void *data1, #define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_ /** + * Declare the current Ruby thread should acquire a dedicated + * native thread on M:N thread scheduler. + * + * If a C extension (or a library which the extension relies on) should + * keep to run on a native thread (e.g. using thread-local-storage), + * this function allocates a dedicated native thread for the thread. + * + * @return `false` if the thread already running on a dedicated native + * thread. Otherwise `true`. + */ +bool rb_thread_lock_native_thread(void); + +/** * Triggered when a new thread is started. * * @note The callback will be called *without* the GVL held. |
