core: Don't create snapshots with locks.

Snapshots are immutable and are never changed. Allocating them
with a lock is wasteful.

Review: https://reviewboard.asterisk.org/r/4469/
........

Merged revisions 432742 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2015-03-10 23:09:49 +00:00
parent 15d266bf85
commit 2889f074a0
3 changed files with 9 additions and 5 deletions

View File

@@ -467,9 +467,10 @@ struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
channel_count = ao2_container_count(endpoint->channel_ids);
snapshot = ao2_alloc(
snapshot = ao2_alloc_options(
sizeof(*snapshot) + channel_count * sizeof(char *),
endpoint_snapshot_dtor);
endpoint_snapshot_dtor,
AO2_ALLOC_OPT_LOCK_NOLOCK);
if (ast_string_field_init(snapshot, 80) != 0) {
return NULL;