mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Wrap linux specific code for internal_thread_proc
This commit is contained in:
+4
-2
@@ -1,4 +1,4 @@
|
|||||||
#if defined(GB_SYSTEM_UNIX)
|
#if defined(GB_SYSTEM_LINUX)
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -361,10 +361,12 @@ 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.
|
#if (GB_SYSTEM_LINUX)
|
||||||
|
// NOTE: Don't permit any signal delivery to threads on Linux.
|
||||||
sigset_t mask = {};
|
sigset_t mask = {};
|
||||||
sigfillset(&mask);
|
sigfillset(&mask);
|
||||||
GB_ASSERT_MSG(pthread_sigmask(SIG_BLOCK, &mask, nullptr) == 0, "failed to block signals");
|
GB_ASSERT_MSG(pthread_sigmask(SIG_BLOCK, &mask, nullptr) == 0, "failed to block signals");
|
||||||
|
#endif
|
||||||
|
|
||||||
Thread *t = cast(Thread *)arg;
|
Thread *t = cast(Thread *)arg;
|
||||||
gb__thread_run(t);
|
gb__thread_run(t);
|
||||||
|
|||||||
Reference in New Issue
Block a user