mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Implement thread_ctrl::is_main()
This commit is contained in:
parent
55c75d2c87
commit
3609eb25c9
@ -2987,3 +2987,8 @@ u64 thread_ctrl::get_tid()
|
||||
return reinterpret_cast<u64>(pthread_self());
|
||||
#endif
|
||||
}
|
||||
|
||||
bool thread_ctrl::is_main()
|
||||
{
|
||||
return get_tid() == utils::main_tid;
|
||||
}
|
||||
|
@ -342,6 +342,9 @@ public:
|
||||
// Get thread ID (works for all threads)
|
||||
static u64 get_tid();
|
||||
|
||||
// Check whether current thread is main thread (usually Qt GUI)
|
||||
static bool is_main();
|
||||
|
||||
private:
|
||||
// Miscellaneous
|
||||
static const u64 process_affinity_mask;
|
||||
|
@ -377,6 +377,8 @@ int main(int argc, char** argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
ensure(thread_ctrl::is_main());
|
||||
|
||||
// Initialize TSC freq (in case it isn't)
|
||||
static_cast<void>(utils::get_tsc_freq());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user