aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-20 21:25:37 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-20 21:25:37 +0000
commitc0d72b8bcf3d347c93f497af8bbda4a7d9dcd155 (patch)
tree52b4488bac42fff2007b708b7d2b63f9009a754c /include
parenteda3be6fb73851d9efb8783cdcdf9fd36b82eeca (diff)
Merged revisions 177701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r177701 | tilghman | 2009-02-20 15:15:01 -0600 (Fri, 20 Feb 2009) | 3 lines This exception does not appear to still be true for Solaris 10, and OpenSolaris definitely needs it to be removed. Fixed for snuff-home on -dev channel. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177732 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/threadstorage.h54
1 files changed, 24 insertions, 30 deletions
diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h
index 13b1e007c..fd4f7847e 100644
--- a/include/asterisk/threadstorage.h
+++ b/include/asterisk/threadstorage.h
@@ -60,12 +60,6 @@ struct ast_threadstorage {
int (*custom_init)(void *); /*!< Custom initialization function specific to the object */
};
-#ifdef SOLARIS
-#define THREADSTORAGE_ONCE_INIT {PTHREAD_ONCE_INIT}
-#else
-#define THREADSTORAGE_ONCE_INIT PTHREAD_ONCE_INIT
-#endif
-
#if defined(DEBUG_THREADLOCALS)
void __ast_threadstorage_object_add(void *key, size_t len, const char *file, const char *function, unsigned int line);
void __ast_threadstorage_object_remove(void *key);
@@ -111,32 +105,32 @@ void __ast_threadstorage_object_replace(void *key_old, void *key_new, size_t len
#if !defined(DEBUG_THREADLOCALS)
#define AST_THREADSTORAGE_CUSTOM_SCOPE(name, c_init, c_cleanup, scope) \
-static void __init_##name(void); \
-scope struct ast_threadstorage name = { \
- .once = THREADSTORAGE_ONCE_INIT, \
- .key_init = __init_##name, \
- .custom_init = c_init, \
-}; \
-static void __init_##name(void) \
-{ \
- pthread_key_create(&(name).key, c_cleanup); \
+static void __init_##name(void); \
+scope struct ast_threadstorage name = { \
+ .once = PTHREAD_ONCE_INIT, \
+ .key_init = __init_##name, \
+ .custom_init = c_init, \
+}; \
+static void __init_##name(void) \
+{ \
+ pthread_key_create(&(name).key, c_cleanup); \
}
#else /* defined(DEBUG_THREADLOCALS) */
-#define AST_THREADSTORAGE_CUSTOM_SCOPE(name, c_init, c_cleanup, scope) \
-static void __init_##name(void); \
-scope struct ast_threadstorage name = { \
- .once = THREADSTORAGE_ONCE_INIT, \
- .key_init = __init_##name, \
- .custom_init = c_init, \
-}; \
-static void __cleanup_##name(void *data) \
-{ \
- __ast_threadstorage_object_remove(data); \
- c_cleanup(data); \
-} \
-static void __init_##name(void) \
-{ \
- pthread_key_create(&(name).key, __cleanup_##name); \
+#define AST_THREADSTORAGE_CUSTOM_SCOPE(name, c_init, c_cleanup, scope) \
+static void __init_##name(void); \
+scope struct ast_threadstorage name = { \
+ .once = PTHREAD_ONCE_INIT, \
+ .key_init = __init_##name, \
+ .custom_init = c_init, \
+}; \
+static void __cleanup_##name(void *data) \
+{ \
+ __ast_threadstorage_object_remove(data); \
+ c_cleanup(data); \
+} \
+static void __init_##name(void) \
+{ \
+ pthread_key_create(&(name).key, __cleanup_##name); \
}
#endif /* defined(DEBUG_THREADLOCALS) */