#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 \
+ ? (! *(ponce) \
+ ? smb_thread_once((ponce), (init_fn)) \
+ : 0) \
+ : ((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)