74 #define PTHREAD_TIMER_BUCKETS 563 157 "max rate of %d / sec\n",
MAX_RATE);
164 if ((timer->
rate = rate)) {
318 if (quantity > pending_ticks) {
340 unsigned char x = 42;
362 unsigned long buffer;
397 struct timeval next_wakeup =
ast_tvnow();
400 struct timespec ts = { 0, };
406 ts.tv_sec = next_wakeup.tv_sec;
407 ts.tv_nsec = next_wakeup.tv_usec * 1000;
440 if (!pthread_timers) {
446 pthread_timers =
NULL;
466 pthread_timers =
NULL;
static unsigned int pthread_timer_get_max_rate(void *data)
static struct ast_timing_interface pthread_timing
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
static int pthread_timer_fd(void *data)
static void ack_ticks(struct pthread_timer *timer, unsigned int num)
#define ast_pipe_nonblock(filedes)
Create a non-blocking pipe.
static struct ao2_container * pthread_timers
static int check_timer(struct pthread_timer *timer)
Time-related functions and macros.
int ast_unregister_timing_interface(void *handle)
Unregister a previously registered timing interface.
unsigned int pending_ticks
static void pthread_timer_destructor(void *obj)
#define ao2_callback(c, flags, cb_fn, arg)
static void * pthread_timer_open(void)
Assume that the ao2_container is already locked.
#define PTHREAD_TIMER_BUCKETS
#define ast_cond_wait(cond, mutex)
#define ast_cond_init(cond, attr)
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ao2_link_flags(container, obj, flags)
#define ast_mutex_lock(a)
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
static int unload_module(void)
static void signal_pipe(struct pthread_timer *timer)
#define ast_cond_signal(cond)
static int pthread_timer_disable_continuous(void *data)
pthread_cond_t ast_cond_t
#define ast_pthread_create_background(a, b, c, d)
static struct @501 timing_thread
Data for the timing thread.
static int run_timer(void *obj, void *arg, int flags)
#define ao2_ref(o, delta)
static int pthread_timer_cmp(void *obj, void *arg, int flags)
static void * do_timing(void *arg)
static int load_module(void)
enum pthread_timer_state state
static int pthread_timer_enable_continuous(void *data)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
#define ao2_unlink(container, obj)
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
static int pthread_timer_set_rate(void *data, unsigned int rate)
#define ao2_alloc(data_size, destructor_fn)
Module has failed to load, may be in an inconsistent state.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
static void unsignal_pipe(struct pthread_timer *timer)
struct timeval ast_tv(ast_time_t sec, ast_suseconds_t usec)
Returns a timeval from sec, usec.
static void * timing_funcs_handle
#define ast_register_timing_interface(i)
Register a set of timing functions.
static int init_timing_thread(void)
#define ast_mutex_init(pmutex)
static enum ast_timer_event pthread_timer_get_event(void *data)
#define ASTERISK_GPL_KEY
The text the key() function should return.
static struct ast_timer * timer
Asterisk module definitions.
#define ast_cond_timedwait(cond, mutex, time)
Timing source management.
Structure for mutex and tracking information.
static void pthread_timer_close(void *data)
#define ast_mutex_unlock(a)
static int pthread_timer_ack(void *data, unsigned int quantity)
static int pthread_timer_hash(const void *obj, const int flags)