runtime: add SA_RESTART flag to signal handler
this improves the preemption latency for x264
@@ -58,7 +58,7 @@ int preempt_init(void)
struct sigaction act;
act.sa_sigaction = handle_sigusr1;
- act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER;
+ act.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER | SA_RESTART;
if (sigemptyset(&act.sa_mask) != 0) {
log_err("couldn't empty the signal handler mask");
