mirror of
https://github.com/emqx/neuron.git
synced 2026-10-27 04:19:50 +08:00
Merge pull request #841 from fengzeroz/main
chore(timer): timestamp update every 10ms
This commit is contained in:
@@ -64,7 +64,7 @@ neu_adapter_t *neu_adapter_create(neu_adapter_info_t *info)
|
||||
neu_event_io_param_t param = { 0 };
|
||||
neu_event_timer_param_t timer_param = {
|
||||
.second = 0,
|
||||
.millisecond = 100,
|
||||
.millisecond = 10,
|
||||
.cb = update_timestamp,
|
||||
};
|
||||
|
||||
|
||||
@@ -103,10 +103,7 @@ static void *event_loop(void *arg)
|
||||
assert(size != -1);
|
||||
|
||||
nng_mtx_lock(data->ctx.timer->mtx);
|
||||
epoll_ctl(epoll_fd, EPOLL_CTL_DEL, data->fd, NULL);
|
||||
ret = data->callback.timer(data->usr_data);
|
||||
timerfd_settime(data->fd, 0, &data->ctx.timer->value, NULL);
|
||||
epoll_ctl(epoll_fd, EPOLL_CTL_ADD, data->fd, &event);
|
||||
nng_mtx_unlock(data->ctx.timer->mtx);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user