|
|
@ -41,7 +41,7 @@ struct sched_context;
|
|
|
|
* \note Create a scheduling context
|
|
|
|
* \note Create a scheduling context
|
|
|
|
* \return Returns a malloc'd sched_context structure, NULL on failure
|
|
|
|
* \return Returns a malloc'd sched_context structure, NULL on failure
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern struct sched_context *sched_context_create(void);
|
|
|
|
struct sched_context *sched_context_create(void);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief destroys a schedule context
|
|
|
|
/*! \brief destroys a schedule context
|
|
|
|
* Destroys (free's) the given sched_context structure
|
|
|
|
* Destroys (free's) the given sched_context structure
|
|
|
@ -69,7 +69,7 @@ typedef int (*ast_sched_cb)(void *data);
|
|
|
|
* \param data data to pass to the callback
|
|
|
|
* \param data data to pass to the callback
|
|
|
|
* \return Returns a schedule item ID on success, -1 on failure
|
|
|
|
* \return Returns a schedule item ID on success, -1 on failure
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, void *data);
|
|
|
|
int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, void *data);
|
|
|
|
|
|
|
|
|
|
|
|
/*!Adds a scheduled event with rescheduling support
|
|
|
|
/*!Adds a scheduled event with rescheduling support
|
|
|
|
* \param con Scheduler context to add
|
|
|
|
* \param con Scheduler context to add
|
|
|
@ -84,7 +84,7 @@ extern int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callb
|
|
|
|
* If callback returns 0, no further events will be re-scheduled
|
|
|
|
* If callback returns 0, no further events will be re-scheduled
|
|
|
|
* \return Returns a schedule item ID on success, -1 on failure
|
|
|
|
* \return Returns a schedule item ID on success, -1 on failure
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable);
|
|
|
|
int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Deletes a scheduled event
|
|
|
|
/*! \brief Deletes a scheduled event
|
|
|
|
* Remove this event from being run. A procedure should not remove its
|
|
|
|
* Remove this event from being run. A procedure should not remove its
|
|
|
@ -93,7 +93,7 @@ extern int ast_sched_add_variable(struct sched_context *con, int when, ast_sched
|
|
|
|
* \param id ID of the scheduled item to delete
|
|
|
|
* \param id ID of the scheduled item to delete
|
|
|
|
* \return Returns 0 on success, -1 on failure
|
|
|
|
* \return Returns 0 on success, -1 on failure
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern int ast_sched_del(struct sched_context *con, int id);
|
|
|
|
int ast_sched_del(struct sched_context *con, int id);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Determines number of seconds until the next outstanding event to take place
|
|
|
|
/*! \brief Determines number of seconds until the next outstanding event to take place
|
|
|
|
* Determine the number of seconds until the next outstanding event
|
|
|
|
* Determine the number of seconds until the next outstanding event
|
|
|
@ -104,7 +104,7 @@ extern int ast_sched_del(struct sched_context *con, int id);
|
|
|
|
* \return Returns "-1" if there is nothing there are no scheduled events
|
|
|
|
* \return Returns "-1" if there is nothing there are no scheduled events
|
|
|
|
* (and thus the poll should not timeout)
|
|
|
|
* (and thus the poll should not timeout)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern int ast_sched_wait(struct sched_context *con);
|
|
|
|
int ast_sched_wait(struct sched_context *con);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Runs the queue
|
|
|
|
/*! \brief Runs the queue
|
|
|
|
* \param con Scheduling context to run
|
|
|
|
* \param con Scheduling context to run
|
|
|
@ -113,19 +113,19 @@ extern int ast_sched_wait(struct sched_context *con);
|
|
|
|
* \param con context to act upon
|
|
|
|
* \param con context to act upon
|
|
|
|
* \return Returns the number of events processed.
|
|
|
|
* \return Returns the number of events processed.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern int ast_sched_runq(struct sched_context *con);
|
|
|
|
int ast_sched_runq(struct sched_context *con);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Dumps the scheduler contents
|
|
|
|
/*! \brief Dumps the scheduler contents
|
|
|
|
* Debugging: Dump the contents of the scheduler to stderr
|
|
|
|
* Debugging: Dump the contents of the scheduler to stderr
|
|
|
|
* \param con Context to dump
|
|
|
|
* \param con Context to dump
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern void ast_sched_dump(const struct sched_context *con);
|
|
|
|
void ast_sched_dump(const struct sched_context *con);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Returns the number of seconds before an event takes place
|
|
|
|
/*! \brief Returns the number of seconds before an event takes place
|
|
|
|
* \param con Context to use
|
|
|
|
* \param con Context to use
|
|
|
|
* \param id Id to dump
|
|
|
|
* \param id Id to dump
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
extern long ast_sched_when(struct sched_context *con,int id);
|
|
|
|
long ast_sched_when(struct sched_context *con,int id);
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
* \brief Convenience macro for objects and reference (add)
|
|
|
|
* \brief Convenience macro for objects and reference (add)
|
|
|
|