#include <stdio.h>#include <stdlib.h>#include <sys/time.h>#include <unistd.h>#include <pthread.h>#include <asterisk/sched.h>#include <asterisk/logger.h>#include <asterisk/channel.h>Include dependency graph for sched.c:

Go to the source code of this file.
Data Structures | |
| struct | sched |
| struct | sched_context |
Defines | |
| #define | DEBUG(a) |
| #define | SOONER(a, b) |
Functions | |
| sched_context * | sched_context_create (void) |
| New schedule context. | |
| void | sched_context_destroy (struct sched_context *con) |
| destroys a schedule context | |
| int | ast_sched_wait (struct sched_context *con) |
| Determines number of seconds until the next outstanding event to take place. | |
| 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. | |
| void | ast_sched_dump (struct sched_context *con) |
| Dumps the scheduler contents. | |
| int | ast_sched_runq (struct sched_context *con) |
| Runs the queue. | |
|
|
|
|
|
Value:
Definition at line 31 of file sched.c. Referenced by ast_sched_runq(). |
|
||||||||||||||||||||
|
Adds a scheduled event.
Definition at line 229 of file sched.c. 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.
Definition at line 260 of file sched.c. 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.
Definition at line 296 of file sched.c. References ast_log(), sched_context::eventcnt, LOG_DEBUG, s, and sched_context::schedq.
|
|
|
Runs the queue.
Definition at line 337 of file sched.c. 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.
Definition at line 138 of file sched.c. 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 61 of file sched.c. References malloc. Referenced by ast_channel_alloc().
|
|
|
destroys a schedule context
Definition at line 78 of file sched.c. References ast_mutex_lock, ast_mutex_unlock, free, sched_context::lock, s, and sched_context::schedq. Referenced by ast_hangup().
|
1.3.7