summaryrefslogtreecommitdiff
path: root/include/ruby/thread_native.h
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2020-11-17 16:40:47 +0900
committerKoichi Sasada <[email protected]>2020-11-18 03:52:41 +0900
commit5e3259ea7490a2542d78c433eb8c9d44c7819e61 ()
tree1a280e725a2c66ca776086661e3b707fd73f4577 /include/ruby/thread_native.h
parent0683912db888b0421ce4c40ad450ccf75ad7e3f4 (diff)
fix public interface
To make some kind of Ractor related extensions, some functions should be exposed. * include/ruby/thread_native.h * rb_native_mutex_* * rb_native_cond_* * include/ruby/ractor.h * RB_OBJ_SHAREABLE_P(obj) * rb_ractor_shareable_p(obj) * rb_ractor_std*() * rb_cRactor and rm ractor_pub.h and rename srcdir/ractor.h to srcdir/ractor_core.h (to avoid conflict with include/ruby/ractor.h)
Notes: Merged: https://.com/ruby/ruby/pull/3775
-rw-r--r--include/ruby/thread_native.h17
1 files changed, 17 insertions, 0 deletions
@@ -31,10 +31,14 @@ typedef union rb_thread_lock_union {
CRITICAL_SECTION crit;
} rb_nativethread_lock_t;
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
typedef pthread_t rb_nativethread_id_t;
typedef pthread_mutex_t rb_nativethread_lock_t;
#else
#error "unsupported thread type"
@@ -50,6 +54,19 @@ void rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock);
void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock);
RUBY_SYMBOL_EXPORT_END
#endif