variable atomic operation in signal handler linux c -


i have declare long long variable , update , checking value in main routine. in signal handler, checking value , updating value. suppose if make operation atomic, during update in main routine, got signal handler, in signal handler if variable in process of update, signal handler not updating status. when control again come back, lost signal handler routine functionality. how can avoid this?

regards.
learner

use sigaction() instead of signal().


Comments