diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-07-19 14:35:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2023-07-19 14:35:43 +0900 |
commit | 0765b890b52975434f1f63fe561e1080ecf17013 (patch) | |
tree | 6291f8d5e9ba9024006a54a277cb1e4c928ea71f /thread_pthread.c | |
parent | a3a74771f23b4e31c1aaa33e2ffb5ba4a1f51ffe (diff) |
Fix `USE_THREAD_CACHE=0`
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index b9b656f469..057c50c124 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -773,6 +773,8 @@ native_thread_destroy(rb_thread_t *th) #if USE_THREAD_CACHE static rb_thread_t *register_cached_thread_and_wait(void *); +#else +# define register_cached_thread_and_wait(altstack) ((void)(altstack), NULL) #endif #if defined HAVE_PTHREAD_GETATTR_NP || defined HAVE_PTHREAD_ATTR_GET_NP @@ -1113,9 +1115,7 @@ thread_start_func_1(void *th_ptr) #else thread_start_func_2(th, &stack_start); #endif - } while (USE_THREAD_CACHE && - /* cache thread */ - (th = register_cached_thread_and_wait(RB_ALTSTACK(altstack))) != 0); + } while ((th = register_cached_thread_and_wait(RB_ALTSTACK(altstack))) != 0); if (!USE_THREAD_CACHE) { RB_ALTSTACK_FREE(altstack); } @@ -1187,6 +1187,8 @@ register_cached_thread_and_wait(void *altstack) # if defined(HAVE_WORKING_FORK) static void thread_cache_reset(void) { } # endif +#define thread_cache_lock *(rb_nativethread_lock_t *)NULL +#define cached_thread_head *(struct ccan_list_head *)NULL #endif static int |