summaryrefslogtreecommitdiff
path: root/sysdep/unix/coroutine.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@jmq.cz>2021-12-01 21:52:55 +0000
committerMaria Matejka <mq@jmq.cz>2021-12-01 21:52:55 +0000
commitb2bac7ae91253b0bd27e9b03ec5fc30ac1522928 (patch)
tree8d8d18cbeaa5516fe5dd498fa53a355b078f6b8c /sysdep/unix/coroutine.c
parent387b279f605c096c6ecb16d6608c700c533edb13 (diff)
Faster shutdown and cleanups by freeing route attributes strictly from main loop
Diffstat (limited to 'sysdep/unix/coroutine.c')
-rw-r--r--sysdep/unix/coroutine.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdep/unix/coroutine.c b/sysdep/unix/coroutine.c
index e4657157..4747d01a 100644
--- a/sysdep/unix/coroutine.c
+++ b/sysdep/unix/coroutine.c
@@ -201,5 +201,6 @@ struct coroutine *coro_run(pool *p, void (*entry)(void *), void *data)
void
coro_yield(void)
{
- usleep(100);
+ const struct timespec req = { .tv_nsec = 100 };
+ nanosleep(&req, NULL);
}