mirror of
https://github.com/emqx/neuron.git
synced 2026-10-28 14:07:20 +08:00
Merge pull request #861 from fengzeroz/main
chore(timer): wait timer end
This commit is contained in:
@@ -105,7 +105,10 @@ static void *event_loop(void *arg)
|
||||
|
||||
if (!data->ctx.timer->stop) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user