diff options
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -241,7 +241,7 @@ static void timer_thread_function(void *); #if THREAD_DEBUG static int debug_mutex_initialized = 1; -static rb_thread_lock_t debug_mutex; +static rb_nativethread_lock_t debug_mutex; void rb_thread_debug( @@ -277,17 +277,29 @@ rb_vm_gvl_destroy(rb_vm_t *vm) } void -rb_thread_lock_unlock(rb_thread_lock_t *lock) +rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock) { - native_mutex_unlock(lock); + native_mutex_initialize(lock); } void -rb_thread_lock_destroy(rb_thread_lock_t *lock) +rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock) { native_mutex_destroy(lock); } +void +rb_nativethread_lock_lock(rb_nativethread_lock_t *lock) +{ + native_mutex_lock(lock); +} + +void +rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock) +{ + native_mutex_unlock(lock); +} + static int set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, void *arg, struct rb_unblock_callback *old, int fail_if_interrupted) @@ -375,7 +387,7 @@ terminate_i(st_data_t key, st_data_t val, rb_thread_t *main_thread) typedef struct rb_mutex_struct { - rb_thread_lock_t lock; + rb_nativethread_lock_t lock; rb_thread_cond_t cond; struct rb_thread_struct volatile *th; int cond_waiting; |