Commit Graph

13 Commits

Author SHA1 Message Date
Tom
63535dc16c test: do not accidentally kill parent process
Use `kill(getpid(), ...)` instead of `kill(0, ...)`.
`kill(0, ...)` sends a signal to the whole process group, not just the
currently executing process. The process group may include a parent
process, for example a bash subshell spawned for a script.
2020-08-01 02:05:43 +02:00
Tom
f62a81797a AtomicCondition: add wait*_value helpers 2020-07-17 23:37:33 +02:00
Tom
fed1e55a23 cmake: rename project to signal-wrangler 2020-07-17 17:05:04 +02:00
Tom
7636620625 SignalHandler: add helper async_sigwait_handler 2020-07-17 16:51:53 +02:00
Tom
346c835468 AtomicCondition: add helpers set_and_notify_{one,all} 2020-07-17 16:50:51 +02:00
Tom
9af897fa3b v0.2
* Preserve interface of std::condition_variable through "perfect
  forwarding"
* Decouple SignalHandler and AtomicCondition
* Callback function for signals
* Improve readme
* Bump version to v0.2
2019-10-13 15:00:20 +02:00
Tom
9aaa7180fc cmake: disable testing, do not build test when building all 2019-10-13 14:53:45 +02:00
Tom
2a04dd5cc1 AtomicCondition: fix race condition, remove notify_{one,all}
* Fix race condition in wait_for between calling atomic load
  and condition_variable::wait_for, by protecting atomic store
  with same mutex as AtomicCondition::wait_for.
* Subsequently, simplify the interface by removing notify_{one,all}.
  condition_varaiable::notify_all is now automatically called in
  `AtomicCondition::set(val)`.
2019-09-23 12:04:28 +02:00
Tom
1438cfc697 test: add cases wait-for-value and wait-for-predicate 2019-09-16 18:13:18 +02:00
Tom
d96e699f95 test: worker: wait for hours, so failure becomes apparent 2019-09-16 18:12:53 +02:00
Tom
21b8c7ca8b test: add case signal-handler-reuse 2019-09-16 18:11:13 +02:00
Tom
e60c80214e improve tests 2019-09-15 21:54:01 +02:00
Tom
076e77ff53 initial import 2019-09-14 22:41:56 +02:00