mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-08-15 00:23:14 +00:00
fix MSYS thread handle cast
This commit is contained in:
parent
f1ff014bca
commit
73021b89e0
1 changed files with 2 additions and 2 deletions
|
@ -45,7 +45,7 @@ set_thread_affinity(const unsigned &cpuid)
|
|||
{
|
||||
std::thread::native_handle_type thread;
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
thread = static_cast<std::thread::native_handle_type>(GetCurrentThread());
|
||||
thread = reinterpret_cast<std::thread::native_handle_type>(GetCurrentThread());
|
||||
#else
|
||||
thread = static_cast<std::thread::native_handle_type>(pthread_self());
|
||||
#endif
|
||||
|
@ -64,7 +64,7 @@ set_thread_affinity(std::thread::native_handle_type thread,
|
|||
rc = thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY,
|
||||
(thread_policy_t)&policy, 1);
|
||||
#elif defined(_WIN32) || defined(__CYGWIN__)
|
||||
rc = SetThreadAffinityMask(static_cast<HANDLE>(thread), 1ULL << cpuid) == 0 ? -2 : 0;
|
||||
rc = SetThreadAffinityMask(reinterpret_cast<HANDLE>(thread), 1ULL << cpuid) == 0 ? -2 : 0;
|
||||
#else
|
||||
cpu_set_t cs;
|
||||
CPU_ZERO(&cs);
|
||||
|
|
Loading…
Reference in a new issue