diff options
Diffstat (limited to 'lib/util/smb_threads_internal.h')
-rw-r--r-- | lib/util/smb_threads_internal.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/util/smb_threads_internal.h b/lib/util/smb_threads_internal.h index 3208bc27e1..58c6fe3f99 100644 --- a/lib/util/smb_threads_internal.h +++ b/lib/util/smb_threads_internal.h @@ -33,20 +33,29 @@ #define SMB_THREAD_LOCK(plock, type) \ (global_tfp ? global_tfp->lock_mutex((plock), (type), __location__) : 0) -#define SMB_THREAD_CREATE_TLS(keyname, key) \ - (global_tfp ? global_tfp->create_tls((keyname), &(key), __location__) : 0) +#define SMB_THREAD_CREATE_TLS_ONCE(keyname, key) \ + (global_tfp ? global_tfp->create_tls_once((keyname), &(key), __location__) : 0) -#define SMB_THREAD_DESTROY_TLS(key) \ +#define SMB_THREAD_DESTROY_TLS_ONCE(key) \ do { \ if (global_tfp) { \ - global_tfp->destroy_tls(key); \ + global_tfp->destroy_tls_once(&(key), __location__); \ }; \ } while (0) #define SMB_THREAD_SET_TLS(key, val) \ - (global_tfp ? global_tfp->set_tls((key),(val),__location__) : 0) + (global_tfp ? global_tfp->set_tls((key),(val),__location__) : \ + ((key) = (val), 0)) #define SMB_THREAD_GET_TLS(key) \ - (global_tfp ? global_tfp->get_tls((key), __location__) : NULL) + (global_tfp ? global_tfp->get_tls((key), __location__) : (key)) + +/* + * Global thread lock list. + */ + +#define NUM_GLOBAL_LOCKS 1 + +#define GLOBAL_LOCK(locknum) (global_lock_array ? global_lock_array[(locknum)] : NULL) #endif |