Fix the previous revision.
This commit is contained in:
parent
7183516d91
commit
8562a40136
1 changed files with 3 additions and 1 deletions
|
@ -342,7 +342,6 @@ empth_select(int fd, int flags)
|
||||||
done:
|
done:
|
||||||
pthread_mutex_lock(&mtx_ctxsw);
|
pthread_mutex_lock(&mtx_ctxsw);
|
||||||
empth_restorectx();
|
empth_restorectx();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -388,6 +387,7 @@ empth_wait_for_shutdown(void)
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, SIGINT);
|
sigaddset(&set, SIGINT);
|
||||||
sigaddset(&set, SIGTERM);
|
sigaddset(&set, SIGTERM);
|
||||||
|
pthread_mutex_unlock(&mtx_ctxsw);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
empth_status("waiting for signals");
|
empth_status("waiting for signals");
|
||||||
err = sigwait(&set, &sig);
|
err = sigwait(&set, &sig);
|
||||||
|
@ -396,6 +396,8 @@ empth_wait_for_shutdown(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
empth_status("got awaited signal %d", sig);
|
empth_status("got awaited signal %d", sig);
|
||||||
|
pthread_mutex_lock(&mtx_ctxsw);
|
||||||
|
empth_restorectx();
|
||||||
return sig;
|
return sig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue