5 ms·
I'd keep an int flag, initialized to zero. If you do, your code is buggy: sig_atomic_t is the only type you can safely use inside and outside a signal handler.
by cperciva 15y ago
I'd keep an int flag, initialized to zero.
If you do, your code is buggy: sig_atomic_t is the only type you can safely use inside and outside a signal handler.
- smcdow 15y agoPlease explain why this would be true for single-threaded applications.
- vonuebelgarten 15y agoBecause your signal handler may get interrupted by another signal.
- smcdow 15y agoSo what? Even then, there will be no concurrency issues in a single threaded application.