diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-01-16 18:09:28 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-01-16 18:09:28 +0000 |
commit | 9b6d9bcf995264b862da3d79f8c5668e82e278b5 (patch) | |
tree | fad89667de4d2838f12c858e8c9062187ecd6eca /main/logger.c | |
parent | 5e46455806e32075b1808bfd63fa360b44f1a224 (diff) |
Reduce call-id logging resource usage.
Since there is no need for the call-id logging ao2 object to have a lock,
don't create it with one.
........
Merged revisions 379232 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/logger.c')
-rw-r--r-- | main/logger.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/main/logger.c b/main/logger.c index b4069605d..3caea6cc5 100644 --- a/main/logger.c +++ b/main/logger.c @@ -1306,16 +1306,14 @@ void ast_callid_strnprint(char *buffer, size_t buffer_size, struct ast_callid *c struct ast_callid *ast_create_callid(void) { struct ast_callid *call; - int using; - if (!(call = ao2_alloc(sizeof(struct ast_callid), NULL))) { + call = ao2_alloc_options(sizeof(struct ast_callid), NULL, AO2_ALLOC_OPT_LOCK_NOLOCK); + if (!call) { ast_log(LOG_ERROR, "Could not allocate callid struct.\n"); return NULL; } - using = ast_atomic_fetchadd_int(&next_unique_callid, +1); - - call->call_identifier = using; + call->call_identifier = ast_atomic_fetchadd_int(&next_unique_callid, +1); ast_debug(3, "CALL_ID [C-%08x] created by thread.\n", call->call_identifier); return call; } |