diff options
author | Koichi Sasada <[email protected]> | 2020-10-19 16:47:32 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-10-20 01:05:06 +0900 |
commit | 319afed20fba8f9b44611d16e4930260f7b56b86 () | |
tree | 39d24da0464a39a2bfbc93f4ab5849945bc6f652 /thread_pthread.h | |
parent | 3f97940252a37db6e601b4bb1aa1e87204f769df (diff) |
Use language TLS specifier if it is possible.
To access TLS, it is faster to use language TLS specifier instead of using pthread_get/setspecific functions. Original proposal is: Use native thread locals. #3665
Notes: Merged: https://.com/ruby/ruby/pull/3667
-rw-r--r-- | thread_pthread.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -83,6 +83,14 @@ typedef struct rb_global_vm_lock_struct { int wait_yield; } rb_global_vm_lock_t; typedef pthread_key_t native_tls_key_t; static inline void * @@ -102,5 +110,20 @@ native_tls_set(native_tls_key_t key, void *ptr) rb_bug("pthread_setspecific error"); } } #endif /* RUBY_THREAD_PTHREAD_H */ |