Go to the source code of this file.
Defines | |
#define | SCHED_MAX_CACHE 128 |
Max num of schedule structs. | |
#define | AST_SCHED_CB(a) ((ast_sched_cb)(a)) |
Typedefs | |
typedef int(* | ast_sched_cb )(void *data) |
callback for a cheops scheduler | |
Functions | |
sched_context * | sched_context_create (void) |
New schedule context. | |
void | sched_context_destroy (struct sched_context *c) |
destroys a schedule context | |
int | ast_sched_add (struct sched_context *con, int when, ast_sched_cb callback, void *data) |
Adds a scheduled event. | |
int | ast_sched_del (struct sched_context *con, int id) |
Deletes a scheduled event. | |
int | ast_sched_wait (struct sched_context *con) |
Determines number of seconds until the next outstanding event to take place. | |
int | ast_sched_runq (struct sched_context *con) |
Runs the queue. | |
void | ast_sched_dump (struct sched_context *con) |
Dumps the scheduler contents. |
|
|
Max num of schedule structs. The max number of schedule structs to keep around for use. Undefine to disable schedule structure caching. (Only disable this on very low memory machines) Definition at line 28 of file sched.h. |
|
callback for a cheops scheduler A cheops scheduler callback takes a pointer with callback data and returns a 0 if it should not be run again, or non-zero if it should be rescheduled to run again Definition at line 53 of file sched.h. Referenced by ast_sched_add(). |
|
Adds a scheduled event.
References ast_log(), ast_mutex_lock, ast_mutex_unlock, ast_sched_cb, DEBUG, sched_context::eventcnt, sched_context::lock, LOG_DEBUG, and LOG_NOTICE.
|
|
Deletes a scheduled event.
References ast_log(), ast_mutex_lock, ast_mutex_unlock, CRASH, DEBUG, sched_context::lock, LOG_DEBUG, LOG_NOTICE, sched::next, s, sched_context::schedcnt, and sched_context::schedq. Referenced by ast_closestream().
|
|
Dumps the scheduler contents.
References ast_log(), sched_context::eventcnt, LOG_DEBUG, s, and sched_context::schedq.
|
|
Runs the queue.
References ast_log(), ast_mutex_lock, ast_mutex_unlock, DEBUG, sched_context::lock, LOG_DEBUG, LOG_NOTICE, sched::next, sched_context::schedcnt, sched_context::schedq, SOONER, and sched::when. Referenced by ast_waitstream(), ast_waitstream_fr(), and ast_waitstream_full().
|
|
Determines number of seconds until the next outstanding event to take place.
References ast_log(), ast_mutex_lock, ast_mutex_unlock, DEBUG, sched_context::lock, LOG_DEBUG, sched_context::schedq, and sched::when. Referenced by ast_waitstream(), ast_waitstream_fr(), and ast_waitstream_full().
|
|
New schedule context. Definition at line 62 of file sched.c. References malloc. Referenced by ast_channel_alloc().
|
|
destroys a schedule context
References ast_mutex_destroy, ast_mutex_lock, ast_mutex_unlock, free, sched_context::lock, s, and sched_context::schedq. Referenced by ast_hangup().
|