mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -209,7 +209,8 @@ struct ast_channel_snapshot *ast_channel_snapshot_create(struct ast_channel *cha
|
||||
return NULL;
|
||||
}
|
||||
|
||||
snapshot = ao2_alloc(sizeof(*snapshot), channel_snapshot_dtor);
|
||||
snapshot = ao2_alloc_options(sizeof(*snapshot), channel_snapshot_dtor,
|
||||
AO2_ALLOC_OPT_LOCK_NOLOCK);
|
||||
if (!snapshot || ast_string_field_init(snapshot, 1024)) {
|
||||
ao2_cleanup(snapshot);
|
||||
return NULL;
|
||||
@@ -617,7 +618,8 @@ void ast_multi_channel_blob_add_channel(struct ast_multi_channel_blob *obj, cons
|
||||
return;
|
||||
}
|
||||
|
||||
role_snapshot = ao2_alloc(sizeof(*role_snapshot) + role_len, channel_role_snapshot_dtor);
|
||||
role_snapshot = ao2_alloc_options(sizeof(*role_snapshot) + role_len, channel_role_snapshot_dtor,
|
||||
AO2_ALLOC_OPT_LOCK_NOLOCK);
|
||||
if (!role_snapshot) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user