* @retval #ERR_ALARM_NO_PERMISSION Permission error
* @remark When a process which registered an alarm is killed, the callback @c handler will not be used.
* In this case, calling the @c alarmmgr_set_cb() can register a callback again.
+ * The callback function may be delayed, due to the processing of other event.
+ * This function corrects the delay as much as possible.
+ *
*/
int alarmmgr_add_alarm_withcb_precision(int alarm_type, time_t trigger_at_time,
time_t interval, alarm_cb_t handler, void *user_param, alarm_id_t *alarm_id);
if (info->msec > 0) {
gettimeofday(¤t_time, NULL);
msec = info->msec - current_time.tv_usec / 1000;
- if (msec > 0)
- g_timeout_add((guint)msec, __handle_millisec_accuracy, info);
- else
+ if (msec > 0) {
+ g_timeout_add_full(G_PRIORITY_HIGH, (guint)msec,
+ __handle_millisec_accuracy, info, NULL);
+ } else {
info->cb_func(alarm_id, info->priv_data);
+ }
} else {
ALARM_MGR_EXCEPTION_PRINT("[alarm-lib] Call expired callback");
info->cb_func(alarm_id, info->priv_data);