From: Tilghman Lesher Date: Fri, 20 Feb 2009 21:15:01 +0000 (+0000) Subject: This exception does not appear to still be true for Solaris 10, and OpenSolaris defin... X-Git-Tag: 1.4.24-rc1~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=426cee03625a3042b8484778e0ffc5fd306cb352;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@177701 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h index 3829b8f1a4..7a08723b16 100644 --- a/include/asterisk/threadstorage.h +++ b/include/asterisk/threadstorage.h @@ -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) */