diff options
author | Corey Farrell <git@cfware.com> | 2017-10-10 16:09:14 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-10-10 20:16:59 -0400 |
commit | 0727a8e5242f4493ff3d7375e6996924cd00cbea (patch) | |
tree | 31575895318417e2dac672585cc82faeec74ec03 /include | |
parent | 7155055b9fda5128d1d7b3b2e163e808873f3800 (diff) |
astobj2: Run weakproxy callbacks outside of lock.
Copy the list of weakproxy callbacks to temporary memory so they can be
run without holding the weakproxy lock.
Change-Id: Ib167622a8a0f873fd73938f7611b2a5914308047
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/astobj2.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index 484e1e35c..9b5ec123b 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -671,6 +671,10 @@ int ao2_weakproxy_subscribe(void *weakproxy, ao2_weakproxy_notification_cb cb, v * of the cb / data pair. If it was subscribed multiple times it must be * unsubscribed as many times. The OBJ_MULTIPLE flag can be used to remove * matching subscriptions. + * + * \note When it's time to run callbacks they are copied to a temporary list so the + * weakproxy can be unlocked before running. That means it's possible for + * this function to find nothing before the callback is run in another thread. */ int ao2_weakproxy_unsubscribe(void *weakproxy, ao2_weakproxy_notification_cb cb, void *data, int flags); |