X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=lib%2Futil%2Fsmb_threads_internal.h;h=29a581b01394ecf4496e844068d1e411b94b830d;hp=0260934e158b6e1e76b985febb56b29628053f04;hb=9a93dc092c6951cdfa6e05c3885a006e5e56d7d3;hpb=404327ad41c5f24f9ace5cad31509149d87197fd diff --git a/lib/util/smb_threads_internal.h b/lib/util/smb_threads_internal.h index 0260934e158..29a581b0139 100644 --- a/lib/util/smb_threads_internal.h +++ b/lib/util/smb_threads_internal.h @@ -33,8 +33,12 @@ #define SMB_THREAD_LOCK(plock, type) \ (global_tfp ? global_tfp->lock_mutex((plock), (type), __location__) : 0) -#define SMB_THREAD_ONCE(ponce, init_fn) \ - (global_tfp ? smb_thread_once((ponce), (init_fn)) : ((init_fn()), 0)) +#define SMB_THREAD_ONCE(ponce, init_fn) \ + (global_tfp \ + ? (! *(ponce) \ + ? smb_thread_once((ponce), (init_fn)) \ + : 0) \ + : ((init_fn()), 0)) #define SMB_THREAD_CREATE_TLS(keyname, key) \ (global_tfp ? global_tfp->create_tls((keyname), &(key), __location__) : 0)