Fix thread affinity on Linux for thread scheduler different than OS

This commit is contained in:
digant73
2026-09-25 23:34:58 +03:00
committed by Elad
parent 9f696db955
commit 6e6ffc5058
+8
View File
@@ -2811,6 +2811,14 @@ void thread_base::initialize(void (*error_cb)())
}
#endif
#if !defined(ANDROID) && (defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__))
// A new thread inherits its creator's affinity mask (e.g. compile workers spawned by a pinned PPU thread): reset it to the process mask
if (g_cfg.core.thread_scheduler != thread_scheduler_mode::os)
{
thread_ctrl::set_thread_affinity_mask(0);
}
#endif
// Initialize TLS variables
thread_ctrl::g_tls_this_thread = this;