74 #define PTHREAD_TIMER_BUCKETS 563
135 int flags = fcntl(timer->
pipe[i], F_GETFL);
137 fcntl(timer->
pipe[i], F_SETFL, flags);
178 "max rate of %d / sec\n",
MAX_RATE);
185 if ((timer->
rate = rate)) {
301 if (!(timer =
ao2_find(pthread_timers, &tmp_timer, flags))) {
380 if (quantity > pending_ticks) {
381 quantity = pending_ticks;
402 unsigned char x = 42;
424 unsigned long buffer;
459 struct timeval next_wakeup =
ast_tvnow();
462 struct timespec ts = { 0, };
468 ts.tv_sec = next_wakeup.tv_sec;
469 ts.tv_nsec = next_wakeup.tv_usec * 1000;
507 pthread_timers = NULL;
527 pthread_timers = NULL;
static struct pthread_timer * find_timer(int handle, int unlinkobj)
static void pthread_timer_close(int handle)
static struct ast_timing_interface pthread_timing
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_link(arg1, arg2)
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
static void ack_ticks(struct pthread_timer *timer, unsigned int num)
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.
static int pthread_timer_ack(int handle, unsigned int quantity)
unsigned int pending_ticks
static void pthread_timer_destructor(void *obj)
#define ao2_callback(c, flags, cb_fn, arg)
#define PTHREAD_TIMER_BUCKETS
#define ast_cond_wait(cond, mutex)
#define ast_cond_init(cond, attr)
static struct @352 timing_thread
Data for the timing thread.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ast_mutex_lock(a)
static int pthread_timer_open(void)
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
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)
pthread_cond_t ast_cond_t
#define ast_pthread_create_background(a, b, c, d)
static int run_timer(void *obj, void *arg, int flags)
static unsigned int pthread_timer_get_max_rate(int handle)
static int pthread_timer_disable_continuous(int handle)
#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
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
#define ao2_alloc(data_size, destructor_fn)
#define ao2_find(arg1, arg2, arg3)
static void unsignal_pipe(struct pthread_timer *timer)
static enum ast_timer_event pthread_timer_get_event(int handle)
#define ao2_container_alloc(arg1, arg2, arg3)
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)
static int pthread_timer_set_rate(int handle, unsigned int rate)
#define ast_mutex_init(pmutex)
#define ASTERISK_GPL_KEY
The text the key() function should return.
static struct ast_timer * timer
Asterisk module definitions.
static int pthread_timer_enable_continuous(int handle)
#define ast_cond_timedwait(cond, mutex, time)
Timing source management.
Structure for mutex and tracking information.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
#define ast_mutex_unlock(a)
static int pthread_timer_hash(const void *obj, const int flags)