projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d6aca7
)
Call pthread_setspecific for every thread that calls fr_thread_local_init, not just...
author
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Mon, 19 Sep 2016 09:52:47 +0000
(13:52 +0400)
committer
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Mon, 19 Sep 2016 09:53:13 +0000
(13:53 +0400)
src/include/threads.h
patch
|
blob
|
history
diff --git
a/src/include/threads.h
b/src/include/threads.h
index
63703b7
..
e36d81d
100644
(file)
--- a/
src/include/threads.h
+++ b/
src/include/threads.h
@@
-75,13
+75,13
@@
static void __fr_thread_local_destroy_##_n(UNUSED void *unused)\
static void __fr_thread_local_key_init_##_n(void)\
{\
(void) pthread_key_create(&__fr_thread_local_key_##_n, __fr_thread_local_destroy_##_n);\
static void __fr_thread_local_key_init_##_n(void)\
{\
(void) pthread_key_create(&__fr_thread_local_key_##_n, __fr_thread_local_destroy_##_n);\
- (void) pthread_setspecific(__fr_thread_local_key_##_n, &(_n));\
}\
static _t __fr_thread_local_init_##_n(pthread_destructor_t func)\
{\
__fr_thread_local_destructor_##_n = func;\
if (_n) return _n; \
(void) pthread_once(&__fr_thread_local_once_##_n, __fr_thread_local_key_init_##_n);\
}\
static _t __fr_thread_local_init_##_n(pthread_destructor_t func)\
{\
__fr_thread_local_destructor_##_n = func;\
if (_n) return _n; \
(void) pthread_once(&__fr_thread_local_once_##_n, __fr_thread_local_key_init_##_n);\
+ (void) pthread_setspecific(__fr_thread_local_key_##_n, &(_n));\
return _n;\
}
# define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f)
return _n;\
}
# define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f)