async-signal-safe is a property by which a programmer can ensure the safety of the signal handler being invoked and prevent it from giving undesirable result.
To ensure a signal handler being async-signal-safe, one must invoke those functions in a signal handler that are reentrant safe that only uses local variables (invoking reentrant functions will have their own stack frame and data variables), avoid using global and static variables because it may modify the data of a global variable as only one copy of a variable exists and it may lead to an undefined behaviour.
If accessing a global and static variable is the only choice left then, to avoid the problem with unsafe functions declare a global and static variable as 'volatile sig_atomic_t' and before accessing a global variable within the signal handler block rest of the signals set, and then unblock them after a signal handler has been successfully executed.