[asterisk-commits] tilghman: branch 1.4 r177701 - /branches/1.4/include/asterisk/threadstorage.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 20 15:15:02 CST 2009


Author: tilghman
Date: Fri Feb 20 15:15:01 2009
New Revision: 177701

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=177701
Log:
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.

Modified:
    branches/1.4/include/asterisk/threadstorage.h

Modified: branches/1.4/include/asterisk/threadstorage.h
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/include/asterisk/threadstorage.h?view=diff&rev=177701&r1=177700&r2=177701
==============================================================================
--- branches/1.4/include/asterisk/threadstorage.h (original)
+++ branches/1.4/include/asterisk/threadstorage.h Fri Feb 20 15:15:01 2009
@@ -43,12 +43,6 @@
 	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 @@
 #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) */
 




More information about the asterisk-commits mailing list