summaryrefslogtreecommitdiff
path: root/res/res_pjsip_registrar.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:57:51 -0500
commite1248c30756ed9f48ba0f06c46a876c5d08cbb11 (patch)
tree977c7dd0686c131445f353356665629eb72f1536 /res/res_pjsip_registrar.c
parent1a3cc843718a35eb69168304c54ec9e7caec6ffd (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_registrar.c')
-rw-r--r--res/res_pjsip_registrar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip_registrar.c b/res/res_pjsip_registrar.c
index aef0e164b..53209575f 100644
--- a/res/res_pjsip_registrar.c
+++ b/res/res_pjsip_registrar.c
@@ -525,12 +525,12 @@ static int register_aor(pjsip_rx_data *rdata,
struct ao2_container *contacts = NULL;
struct ast_named_lock *lock;
- lock = ast_named_lock_get(AST_NAMED_LOCK_TYPE_RWLOCK, "aor", aor_name);
+ lock = ast_named_lock_get(AST_NAMED_LOCK_TYPE_MUTEX, "aor", aor_name);
if (!lock) {
return PJ_TRUE;
}
- ao2_wrlock(lock);
+ ao2_lock(lock);
contacts = ast_sip_location_retrieve_aor_contacts_nolock(aor);
if (!contacts) {
ao2_unlock(lock);