diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-04-15 14:36:13 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-04-15 14:36:13 +1000 |
commit | 4678d1c6f4de1af9144de37d6d4b35c6c39e254d (patch) | |
tree | 94e58cf112ef34412bc5521f4bc9f56424ee967f /lib/util/smb_threads_internal.h | |
parent | 86b50a0e6eacc14e157602811f30f11dccc471a8 (diff) | |
parent | 92d321006d1748ac47cf9b52330212f4ae03f502 (diff) | |
download | samba-4678d1c6f4de1af9144de37d6d4b35c6c39e254d.tar.gz samba-4678d1c6f4de1af9144de37d6d4b35c6c39e254d.tar.bz2 samba-4678d1c6f4de1af9144de37d6d4b35c6c39e254d.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba into libcli-auth-merge-without-netlogond
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 |