summaryrefslogtreecommitdiff
path: root/res/res_pjsip/location.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-08-03 16:24:39 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-08-11 11:58:38 -0500
commit5ba6357be2a140e558ddc14b7669bb08d035944d (patch)
tree048f51a0e7fafb5246e46510e957f739e45e8387 /res/res_pjsip/location.c
parente845ef6762bdfd404f1f3f2b5c22c66e49eaec68 (diff)
res_pjsip: Make aor named lock a mutex.
The named aor lock was always being locked for writes so a rwlock adds no benefit and may be slower because rwlocks are biased toward read locking. Change-Id: I8c5c2c780eb30ce5441832257beeb3506fd12b28
Diffstat (limited to 'res/res_pjsip/location.c')
-rw-r--r--res/res_pjsip/location.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 46278dd0c..c0c4a1f15 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -209,12 +209,12 @@ struct ao2_container *ast_sip_location_retrieve_aor_contacts(const struct ast_si
struct ao2_container *contacts;
struct ast_named_lock *lock;
- lock = ast_named_lock_get(AST_NAMED_LOCK_TYPE_RWLOCK, "aor", ast_sorcery_object_get_id(aor));
+ lock = ast_named_lock_get(AST_NAMED_LOCK_TYPE_MUTEX, "aor", ast_sorcery_object_get_id(aor));
if (!lock) {
return NULL;
}
- ao2_wrlock(lock);
+ ao2_lock(lock);
contacts = ast_sip_location_retrieve_aor_contacts_nolock(aor);
ao2_unlock(lock);
ast_named_lock_put(lock);
@@ -368,12 +368,12 @@ int ast_sip_location_add_contact(struct ast_sip_aor *aor, const char *uri,
int res;
struct ast_named_lock *lock;
- lock = ast_named_lock_get(AST_NAMED_LOCK_TYPE_RWLOCK, "aor", ast_sorcery_object_get_id(aor));
+ lock = ast_named_lock_get(AST_NAMED_LOCK_TYPE_MUTEX, "aor", ast_sorcery_object_get_id(aor));
if (!lock) {
return -1;
}
- ao2_wrlock(lock);
+ ao2_lock(lock);
res = ast_sip_location_add_contact_nolock(aor, uri, expiration_time, path_info, user_agent,
via_addr, via_port, call_id,
endpoint);