Hacker News new | past | comments | ask | show | jobs | submit login

sizeof(_Bool) is probably 1. Whether someone is using stdbool.h or some other bool define (int is common enough) is unassumable. Not all CPUs can do atomic byte operations, so they're going to read/modify/write a machine word at a time.

I'm not sure how much you'd have to mark volatile to get a compiler to behave the way you want, so you could use int and dodge the issue. Or better, the standard sigatomic_t type is provided and should work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: