]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
This exception does not appear to still be true for Solaris 10, and OpenSolaris defin...
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 20 Feb 2009 21:15:01 +0000 (21:15 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 20 Feb 2009 21:15:01 +0000 (21:15 +0000)
Fixed for snuff-home on -dev channel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177701 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/threadstorage.h

index 3829b8f1a4130018a2da8e734e54530ac1d67608..7a08723b16e1575e6a7c4f8cdbed20ef426651d7 100644 (file)
@@ -43,12 +43,6 @@ struct ast_threadstorage {
        void (*key_init)(void);
 };
 
-#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);
@@ -77,28 +71,28 @@ void __ast_threadstorage_object_replace(void *key_old, void *key_new, size_t len
 #define AST_THREADSTORAGE_CUSTOM(name, name_init, cleanup)  \
 static void name_init(void);                                \
 static struct ast_threadstorage name = {                    \
-       .once = THREADSTORAGE_ONCE_INIT,                    \
-       .key_init = name_init,                              \
+       .once = PTHREAD_ONCE_INIT,                              \
+       .key_init = name_init,                                  \
 };                                                          \
 static void name_init(void)                                 \
 {                                                           \
-       pthread_key_create(&(name).key, cleanup);           \
+       pthread_key_create(&(name).key, cleanup);               \
 }
 #else /* defined(DEBUG_THREADLOCALS) */
 #define AST_THREADSTORAGE_CUSTOM(name, name_init, cleanup)  \
 static void name_init(void);                                \
 static struct ast_threadstorage name = {                    \
-       .once = THREADSTORAGE_ONCE_INIT,                    \
-       .key_init = name_init,                              \
+       .once = PTHREAD_ONCE_INIT,                              \
+       .key_init = name_init,                                  \
 };                                                          \
-static void __cleanup_##name(void *data)                   \
-{                                                          \
-       __ast_threadstorage_object_remove(data);            \
-       cleanup(data);                                      \
-}                                                          \
+static void __cleanup_##name(void *data)                    \
+{                                                           \
+       __ast_threadstorage_object_remove(data);                \
+       cleanup(data);                                          \
+}                                                           \
 static void name_init(void)                                 \
 {                                                           \
-       pthread_key_create(&(name).key, __cleanup_##name);  \
+       pthread_key_create(&(name).key, __cleanup_##name);      \
 }
 #endif /* defined(DEBUG_THREADLOCALS) */