[Asterisk-code-review] lock: Add named lock capability (asterisk[13])

George Joseph asteriskteam at digium.com
Fri Apr 1 13:20:00 CDT 2016


Hello Anonymous Coward #1000019,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/2521

to look at the new patch set (#3).

Change subject: lock:  Add named lock capability
......................................................................

lock:  Add named lock capability

Locking some objects like sorcery objects can be tricky because the underlying
ao2 object may not be the same for all callers.  For instance, two threads that
call ast_sorcery_retrieve_by_id on the same aor name might actually get 2
different ao2 objects if the underlying wizard had to rehydrate the aor from a
database. Locking one ao2 object doesn't have any effect on the other.

Named locks allow access control by keyspace and key strings.  Now an "aor"
named "1000" can be locked and any other thread attempting to lock "aor" "1000"
will wait regardless of whether the underlying ao2 object is the same or not.
Mutex and rwlocks are supported.

This capability will initially be used to lock an aor when multiple threads may
be attempting to prune expired contacts from it.

Change-Id: If258c0b7f92b02d07243ce70e535821a1ea7fb45
---
M include/asterisk/_private.h
M include/asterisk/lock.h
M main/asterisk.c
M main/lock.c
A tests/test_named_lock.c
5 files changed, 393 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/2521/3
-- 
To view, visit https://gerrit.asterisk.org/2521
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If258c0b7f92b02d07243ce70e535821a1ea7fb45
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Anonymous Coward #1000019



More information about the asterisk-code-review mailing list