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
This commit is contained in:
Richard Mudgett
2018-03-22 13:35:04 -05:00
parent 36f94cbcde
commit c4f02c975b
2 changed files with 56 additions and 48 deletions

View File

@@ -1702,7 +1702,7 @@ struct ast_sip_sched_task;
*
*/
struct ast_sip_sched_task *ast_sip_schedule_task(struct ast_taskprocessor *serializer,
int interval, ast_sip_task sip_task, char *name, void *task_data,
int interval, ast_sip_task sip_task, const char *name, void *task_data,
enum ast_sip_scheduler_task_flags flags);
/*!