Suppose in main I register 2 signal handlers for SIGUSR1 and SIGUR2, let's say sig_ur1 and sig_ur2. What's gonna happen when signal SIGUR2 arrives when sig_ur1 is running?
sig_ur1 running ----> signal SIGUR2 arrives ----> :
sig_ur1keeps running ->sig_ur1finishes ->sig_ur2starts to run ->sig_ur2finishes -> return tomainsig_ur2starts to run ->sig_ur2finishes -> return tomainsig_ur2starts to run ->sig_ur2finishes ->sig_ur1restores(variables keep the same value whensig_ur1left) ->sig_ur1finishes -> return tomainsig_ur2starts to run ->sig_ur2finishes ->sig_ur1restarts(all variables are initialized again) ->sig_ur1finishes -> return tomain
Which option is the correct one? Or neither is correct? I did not find any articles/posts talking about this, so providing any related material/links would be much appreciated. :)