mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Don't permit any signal delivery to threads on Linux
This commit is contained in:
@@ -357,6 +357,11 @@ void gb__thread_run(Thread *t) {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void *internal_thread_proc(void *arg) {
|
void *internal_thread_proc(void *arg) {
|
||||||
|
// NOTE: Don't permit any signal delivery to threads.
|
||||||
|
sigset_t mask = {};
|
||||||
|
sigfillset(&mask);
|
||||||
|
GB_ASSERT_MSG(pthread_sigmask(SIG_BLOCK, &mask, nullptr) == 0, "failed to block signals");
|
||||||
|
|
||||||
Thread *t = cast(Thread *)arg;
|
Thread *t = cast(Thread *)arg;
|
||||||
gb__thread_run(t);
|
gb__thread_run(t);
|
||||||
t->is_running.store(false);
|
t->is_running.store(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user