0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-15 07:38:43 +00:00
Commit Graph

6 Commits

Author SHA1 Message Date
Jan Maria Matejka
1e52cd6ac1 Coroutines: update coro_done to schedule an event 2018-09-14 14:39:56 +02:00
Jan Maria Matejka
2312622923 Coroutine: use pthread_exit() instead of pthread_cancel()
The coroutine itself may hold some resources when going across pthread
cancellable points. Now it is ensured (by semaphores) that either the
main process or the coroutine is running so the coroutine is always
cancelled inside coro_suspend() where everything is clean but it will
change in future.

Instead, we explicitly mark the coroutine freeze/cancel points by
yielding there -- calling coro_suspend() and checking whether the
master process has requested to stop.

Where pthread_cancel() was, we instead set a flag and resume that
thread to finish its work and exit itself.
2018-09-13 11:10:27 +02:00
Jan Maria Matejka
4600e95fe4 Coro: Fixed deadlock when CLI is killed. 2018-08-28 16:49:43 +02:00
Jan Maria Matejka
d3a403636a Coroutines: Adapted to new timers and set to pthreads if possible 2018-08-28 13:12:25 +02:00
Martin Mares
f9cbd62051 Another implementation of coroutines using pthreads 2017-07-19 00:21:42 +02:00
Martin Mares
774121633f Co-routines moved to a separate module with sysdep implementation 2017-07-18 23:01:06 +02:00