* at the top of the source tree.
*/
-/*!
+/*!
* \file
* \author Russell Bryant <russell@digium.com>
*
- * \brief pthread timing interface
+ * \brief pthread timing interface
*/
#include "asterisk.h"
if (timer->state != TIMER_STATE_CONTINUOUS) {
set_state(timer);
}
-
+
ao2_unlock(timer);
ao2_ref(timer, -1);
}
/*!
- * \note only PIPE_READ is guaranteed valid
+ * \note only PIPE_READ is guaranteed valid
*/
static int pthread_timer_hash(const void *obj, const int flags)
{
}
/*!
- * \note only PIPE_READ is guaranteed valid
+ * \note only PIPE_READ is guaranteed valid
*/
static int pthread_timer_cmp(void *obj, void *arg, int flags)
{
struct timeval now;
if (timer->state == TIMER_STATE_IDLE || timer->state == TIMER_STATE_CONTINUOUS) {
- return 0;
+ return 0;
}
-
+
now = ast_tvnow();
if (timer->tick_count < (ast_tvdiff_ms(now, timer->start) / timer->interval)) {
break;
}
- res = read(rd_fd, buf,
+ res = read(rd_fd, buf,
(quantity < sizeof(buf)) ? quantity : sizeof(buf));
if (res == -1) {
ssize_t res;
unsigned char x = 42;
- res = write(wr_fd, &x, 1);
+ res = write(wr_fd, &x, 1);
if (res == -1) {
if (errno == EAGAIN) {
if (check_timer(timer)) {
write_byte(timer->pipe[PIPE_WRITE]);
}
-
+
ao2_unlock(timer);
return 0;
static int load_module(void)
{
- if (!(pthread_timers = ao2_container_alloc(PTHREAD_TIMER_BUCKETS,
+ if (!(pthread_timers = ao2_container_alloc(PTHREAD_TIMER_BUCKETS,
pthread_timer_hash, pthread_timer_cmp))) {
return AST_MODULE_LOAD_DECLINE;
}