Wladimir J. van der Laan cd03513dc2 init: Signal-safe instant shutdown
Replace the 200ms polling loop with a faster and more efficient waiting
operation.

This was tried a few times before, but given up every time because
solutions use a condition variable which is not safe for use in signals
as they need to be reentrant.

On UNIX-ish OSes, use a safe way: a pipe. When shutdown is requested
write a dummy byte to the pipe. Waiting for shutdown is a matter of a
blocking read from the pipe.

On Windows, there are no signals so using a condition variable is safe.
2020-12-15 17:21:06 +01:00
..
2020-11-25 14:38:33 +02:00
2020-10-12 12:14:53 -07:00
2020-11-19 15:48:24 +01:00
2020-10-09 14:29:04 +03:00
2020-10-09 14:29:04 +03:00
2020-11-26 09:07:33 +00:00
2020-08-27 20:07:27 -04:00
2020-07-01 14:44:28 -04:00
2020-07-01 14:44:28 -04:00
2020-07-08 14:26:14 +03:00
2020-10-12 02:06:32 -07:00
2020-11-23 21:02:54 +00:00
2020-12-15 17:21:06 +01:00
2020-10-14 11:18:12 -04:00
2020-10-14 11:18:12 -04:00
2020-10-14 11:18:12 -04:00
2020-11-16 15:54:24 -03:00
2020-07-01 18:03:12 -04:00
2020-04-30 09:19:14 -04:00
2020-06-21 06:02:59 -04:00
2020-06-21 06:02:59 -04:00
2020-12-15 17:21:06 +01:00
2020-07-01 14:44:24 -04:00
2020-10-12 12:14:53 -07:00
2020-10-12 11:01:16 -07:00
2020-10-12 11:01:16 -07:00