diff options
author | Jeremy Allison <jra@samba.org> | 2009-04-20 03:04:42 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-04-20 03:04:42 -0700 |
commit | 3d2e95c296a1858986b9c806dff67c9cc3d8f70d (patch) | |
tree | 70d1b5f20c483061f80c515fd23832fb9e0fdf24 /lib/util/smb_threads_internal.h | |
parent | 03abc846ee14a08e585c0997a6235ea01db8352f (diff) | |
download | samba-3d2e95c296a1858986b9c806dff67c9cc3d8f70d.tar.gz samba-3d2e95c296a1858986b9c806dff67c9cc3d8f70d.tar.bz2 samba-3d2e95c296a1858986b9c806dff67c9cc3d8f70d.zip |
Fix the pthread_once initialization issue. Make talloc_stackframe use
this.
Jeremy.
Diffstat (limited to 'lib/util/smb_threads_internal.h')
-rw-r--r-- | lib/util/smb_threads_internal.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/util/smb_threads_internal.h b/lib/util/smb_threads_internal.h index 58c6fe3f99..b7e862af72 100644 --- a/lib/util/smb_threads_internal.h +++ b/lib/util/smb_threads_internal.h @@ -33,13 +33,16 @@ #define SMB_THREAD_LOCK(plock, type) \ (global_tfp ? global_tfp->lock_mutex((plock), (type), __location__) : 0) -#define SMB_THREAD_CREATE_TLS_ONCE(keyname, key) \ - (global_tfp ? global_tfp->create_tls_once((keyname), &(key), __location__) : 0) +#define SMB_THREAD_ONCE(ponce, init_fn) \ + (global_tfp ? global_tfp->smb_thread_once((ponce), (init_fn)) : ((init_fn()), 0)) -#define SMB_THREAD_DESTROY_TLS_ONCE(key) \ +#define SMB_THREAD_CREATE_TLS(keyname, key) \ + (global_tfp ? global_tfp->create_tls((keyname), &(key), __location__) : 0) + +#define SMB_THREAD_DESTROY_TLS(key) \ do { \ if (global_tfp) { \ - global_tfp->destroy_tls_once(&(key), __location__); \ + global_tfp->destroy_tls(&(key), __location__); \ }; \ } while (0) |