diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-12-13 08:36:35 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-12-13 08:36:35 +0000 |
commit | c8223fc9578754dfaef1b337e5f0dfff546461b4 (patch) | |
tree | 0559c99680217b78c0bda37a131b5f09794f43c6 /include/asterisk/threadstorage.h | |
parent | 3b96ae826e7e280bff1d16ddc50d9328c7ea70ac (diff) |
Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/threadstorage.h')
-rw-r--r-- | include/asterisk/threadstorage.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h index cf6d47e32..ab586974f 100644 --- a/include/asterisk/threadstorage.h +++ b/include/asterisk/threadstorage.h @@ -85,7 +85,11 @@ void __ast_threadstorage_object_replace(void *key_old, void *key_new, size_t len * \endcode */ #define AST_THREADSTORAGE(name) \ - AST_THREADSTORAGE_CUSTOM(name, NULL, ast_free_ptr) + AST_THREADSTORAGE_CUSTOM_SCOPE(name, NULL, ast_free_ptr, static) +#define AST_THREADSTORAGE_PUBLIC(name) \ + AST_THREADSTORAGE_CUSTOM_SCOPE(name, NULL, ast_free_ptr,) +#define AST_THREADSTORAGE_EXTERNAL(name) \ + extern struct ast_threadstorage name /*! * \brief Define a thread storage variable, with custom initialization and cleanup @@ -103,10 +107,12 @@ void __ast_threadstorage_object_replace(void *key_old, void *key_new, size_t len * AST_THREADSTORAGE_CUSTOM(my_buf, my_init, my_cleanup); * \endcode */ +#define AST_THREADSTORAGE_CUSTOM(a,b,c) AST_THREADSTORAGE_CUSTOM_SCOPE(a,b,c,static) + #if !defined(DEBUG_THREADLOCALS) -#define AST_THREADSTORAGE_CUSTOM(name, c_init, c_cleanup) \ +#define AST_THREADSTORAGE_CUSTOM_SCOPE(name, c_init, c_cleanup, scope) \ static void __init_##name(void); \ -static struct ast_threadstorage name = { \ +scope struct ast_threadstorage name = { \ .once = THREADSTORAGE_ONCE_INIT, \ .key_init = __init_##name, \ .custom_init = c_init, \ @@ -116,9 +122,9 @@ static void __init_##name(void) \ pthread_key_create(&(name).key, c_cleanup); \ } #else /* defined(DEBUG_THREADLOCALS) */ -#define AST_THREADSTORAGE_CUSTOM(name, c_init, c_cleanup) \ +#define AST_THREADSTORAGE_CUSTOM_SCOPE(name, c_init, c_cleanup, scope) \ static void __init_##name(void); \ -static struct ast_threadstorage name = { \ +scope struct ast_threadstorage name = { \ .once = THREADSTORAGE_ONCE_INIT, \ .key_init = __init_##name, \ .custom_init = c_init, \ |