pjsip_scheduler.c: Fix ao2 usage errors.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 22 Mar 2018 18:35:04 +0000 (13:35 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 9 Apr 2018 22:12:53 +0000 (17:12 -0500)
commit7157dcf83bcaa4dba32c96d949456f049b1abbd6
tree4f2e4098136a1789bbb08424514455c707371e98
parent2a6072a9c414a8fb7ecb1b6598873e60ef8cadf2
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
include/asterisk/res_pjsip.h
res/res_pjsip/pjsip_scheduler.c