*/
unsigned int ast_timer_get_max_rate(const struct ast_timer *handle);
+/*!
+ * \brief Get name of timer in use
+ *
+ * \param handle timer handle returned by timer_open()
+ *
+ * \return name of timer
+ * \since 1.6.2
+ */
+const char *ast_timer_get_name(const struct ast_timer *handle);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
return -1;
}
+ ao2_lock(our_timer);
our_timer->saved_timer.it_value.tv_sec = 0;
our_timer->saved_timer.it_value.tv_nsec = rate ? (long) (1000000000 / rate) : 0L;
res = timerfd_settime(handle, 0, &our_timer->saved_timer, NULL);
}
+ ao2_unlock(our_timer);
ao2_ref(our_timer, -1);
return res;
ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
return -1;
}
+ ao2_lock(our_timer);
if (our_timer->is_continuous) {
/*It's already in continous mode, no need to do
* anything further
*/
+ ao2_unlock(our_timer);
ao2_ref(our_timer, -1);
return 0;
}
res = timerfd_settime(handle, 0, &continuous_timer, &our_timer->saved_timer);
our_timer->is_continuous = 1;
+ ao2_unlock(our_timer);
ao2_ref(our_timer, -1);
return res;
}
ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
return -1;
}
+ ao2_lock(our_timer);
if(!our_timer->is_continuous) {
/* No reason to do anything if we're not
res = timerfd_settime(handle, 0, &our_timer->saved_timer, NULL);
our_timer->is_continuous = 0;
memset(&our_timer->saved_timer, 0, sizeof(our_timer->saved_timer));
+ ao2_unlock(our_timer);
ao2_ref(our_timer, -1);
return res;
}
ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
return -1;
}
+ ao2_lock(our_timer);
if (our_timer->is_continuous) {
res = AST_TIMING_EVENT_CONTINUOUS;
res = AST_TIMING_EVENT_EXPIRED;
}
+ ao2_unlock(our_timer);
ao2_ref(our_timer, -1);
return res;
}