aboutsummaryrefslogtreecommitdiff
path: root/src/threading.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/threading.cpp')
-rw-r--r--src/threading.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/threading.cpp b/src/threading.cpp
index 61f9df2db..8e1ee8104 100644
--- a/src/threading.cpp
+++ b/src/threading.cpp
@@ -356,7 +356,12 @@ void gb__thread_run(Thread *t) {
return 0;
}
#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;
gb__thread_run(t);
t->is_running.store(false);