mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
[Core] Scheduler: Fix race between switch_scheduler_add_task() and task_thread_loop(). Add new switch_scheduler_add_task_ex() method.
This commit is contained in:
@@ -66,6 +66,23 @@ SWITCH_DECLARE(uint32_t) switch_scheduler_add_task(time_t task_runtime,
|
||||
switch_scheduler_func_t func,
|
||||
const char *desc, const char *group, uint32_t cmd_id, void *cmd_arg, switch_scheduler_flag_t flags);
|
||||
|
||||
/*!
|
||||
\brief Schedule a task in the future
|
||||
\param task_runtime the time in epoch seconds to execute the task.
|
||||
\param func the callback function to execute when the task is executed.
|
||||
\param desc an arbitrary description of the task.
|
||||
\param group a group id tag to link multiple tasks to a single entity.
|
||||
\param cmd_id an arbitrary index number be used in the callback.
|
||||
\param cmd_arg user data to be passed to the callback.
|
||||
\param flags flags to alter behaviour
|
||||
\param task_id pointer to put the id of the task to
|
||||
\return the id of the task
|
||||
*/
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_scheduler_add_task_ex(time_t task_runtime,
|
||||
switch_scheduler_func_t func,
|
||||
const char *desc, const char *group, uint32_t cmd_id, void *cmd_arg, switch_scheduler_flag_t flags, uint32_t *task_id);
|
||||
|
||||
/*!
|
||||
\brief Delete a scheduled task
|
||||
\param task_id the id of the task
|
||||
|
||||
Reference in New Issue
Block a user