mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-12 02:09:17 +00:00
Fix thread affinity on Linux for thread scheduler different than OS
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user