Call only asynchronous-safe functions within signal handlers