Browse Source

Use usleep() instead.

pull/1200/head
Damir Nedžibović 5 years ago
parent
commit
91f72455c9
1 changed files with 1 additions and 13 deletions
  1. +1
    -13
      daemon/poller.c

+ 1
- 13
daemon/poller.c View File

@ -598,18 +598,6 @@ now:
}
}
static void sleep_ms(int ms) {
struct timespec deadline;
long next_tick;
clock_gettime(CLOCK_MONOTONIC, &deadline);
next_tick = (deadline.tv_sec * 1000000000L + deadline.tv_nsec) + ms * 1000000;
deadline.tv_sec = next_tick / 1000000000L;
deadline.tv_nsec = next_tick % 1000000000L;
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &deadline, NULL);
}
void poller_loop(void *d) {
struct poller_map *map = d;
poller_map_add(map);
@ -618,7 +606,7 @@ void poller_loop(void *d) {
while (!rtpe_shutdown) {
int ret = poller_poll(p, 100);
if (ret < 0)
sleep_ms(20);
usleep(20 * 1000);
}
}


Loading…
Cancel
Save