diff --git a/daemon/main.c b/daemon/main.c index 5a08a9d76..2a2143742 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -115,8 +115,8 @@ static void sighandler(gpointer x) { sigaddset(&ss, SIGUSR1); sigaddset(&ss, SIGUSR2); - ts.tv_sec = 10; - ts.tv_nsec = 0; + ts.tv_sec = thread_sleep_time / 1000; + ts.tv_nsec = (thread_sleep_time % 1000) * 1000 * 1000; while (!rtpe_shutdown) { thread_cancel_enable(); diff --git a/daemon/poller.c b/daemon/poller.c index be6f73adb..e07b393ea 100644 --- a/daemon/poller.c +++ b/daemon/poller.c @@ -616,7 +616,7 @@ void poller_loop2(void *d) { struct poller *p = d; while (!rtpe_shutdown) { - int ret = poller_poll(p, 10000); + int ret = poller_poll(p, thread_sleep_time); if (ret < 0) usleep(20 * 1000); } diff --git a/include/aux.h b/include/aux.h index 1092bd334..32126831f 100644 --- a/include/aux.h +++ b/include/aux.h @@ -351,6 +351,7 @@ INLINE void thread_create_detach(void (*f)(void *), void *a, const char *name) { #define thread_cancel_enable() pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) #define thread_cancel_disable() pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) +#define thread_sleep_time 10000 /* ms */