summaryrefslogtreecommitdiff
path: root/lib/util/smb_threads_internal.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-04-14 12:23:22 -0700
committerJeremy Allison <jra@samba.org>2009-04-14 12:23:22 -0700
commit27a3118bcf6105848e8200c15ebab910831f73c6 (patch)
treeba082a0cfd2f6e7f664bd016ba3fe14d12fda676 /lib/util/smb_threads_internal.h
parent48f14949b1b9a377c2af489032de02a0fe4d118b (diff)
downloadsamba-27a3118bcf6105848e8200c15ebab910831f73c6.tar.gz
samba-27a3118bcf6105848e8200c15ebab910831f73c6.tar.bz2
samba-27a3118bcf6105848e8200c15ebab910831f73c6.zip
Make talloc_stack threadsafe using TLS. Volker please
check. Passes make test and basic valgrind testing. Jeremy.
Diffstat (limited to 'lib/util/smb_threads_internal.h')
-rw-r--r--lib/util/smb_threads_internal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/util/smb_threads_internal.h b/lib/util/smb_threads_internal.h
index 3208bc27e1..ad05aae9a5 100644
--- a/lib/util/smb_threads_internal.h
+++ b/lib/util/smb_threads_internal.h
@@ -44,9 +44,10 @@
} 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))
#endif