Signal Handlers - Possible Solution: Flag but this is still not safe... not all data types can be accessed atomically same old locking issue again int should be safe everywhere - but there is no guarantee fortunately, there is sig_atomic_t - that is guaranteed to be atomically accessible.