[Asterisk-code-review] pjsip scheduler.c: Fix ao2 usage errors. (asterisk[15])

Richard Mudgett asteriskteam at digium.com
Mon Apr 9 18:25:50 CDT 2018


Richard Mudgett has uploaded a new patch set (#3). ( https://gerrit.asterisk.org/8747 )

Change subject: pjsip_scheduler.c: Fix ao2 usage errors.
......................................................................

pjsip_scheduler.c: Fix ao2 usage errors.

* Removed several invalid uses of OBJ_NOLOCK.  These uses resulted in the
'tasks' container being accessed without a lock in a multi-threaded
environment.  A recipe for crashes.

* Removed needlessly obtaining schtd object references.  If the caller
providing you a pointer to an object doesn't have a valid reference then
you cannot safely get one from it.

* Getting a ref to 'tasks' when you aren't copying the pointer into
another location is useless.  The 'tasks' container pointer is global.

* Removed many unnecessary uses of RAII_VAR.

* Make ast_sip_schedule_task() name parameter const.

ASTERISK_26806

Change-Id: I5c62488e651314e2a1dbc01f5b078a15512d73db
---
M include/asterisk/res_pjsip.h
M res/res_pjsip/pjsip_scheduler.c
2 files changed, 56 insertions(+), 48 deletions(-)


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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5c62488e651314e2a1dbc01f5b078a15512d73db
Gerrit-Change-Number: 8747
Gerrit-PatchSet: 3
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180409/588b41e2/attachment-0001.html>


More information about the asterisk-code-review mailing list