Commit 460b66b1 authored by Jeff Garzik's avatar Jeff Garzik Committed by Jeff Garzik

Remove obsolete Win32 AffinityBugWorkaround()

Reference miner exists for testnet-in-a-box type situations, and as a
reference.  We don't care enough about highly optimized internal
mining to keep workarounds like this.
parent 940e22fd
......@@ -3361,8 +3361,6 @@ void static BitcoinMiner(CWallet *pwallet)
while (fGenerateBitcoins)
if (AffinityBugWorkaround(ThreadBitcoinMiner))
if (fShutdown)
while (vNodes.empty() || IsInitialBlockDownload())
......@@ -706,26 +706,6 @@ inline void ExitThread(size_t nExitCode)
inline bool AffinityBugWorkaround(void(*pfn)(void*))
#ifdef WIN32
// Sometimes after a few hours affinity gets stuck on one processor
DWORD_PTR dwProcessAffinityMask = -1;
DWORD_PTR dwSystemAffinityMask = -1;
GetProcessAffinityMask(GetCurrentProcess(), &dwProcessAffinityMask, &dwSystemAffinityMask);
DWORD dwPrev1 = SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinityMask);
DWORD dwPrev2 = SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinityMask);
if (dwPrev2 != dwProcessAffinityMask)
printf("AffinityBugWorkaround() : SetThreadAffinityMask=%d, ProcessAffinityMask=%d, restarting thread\n", dwPrev2, dwProcessAffinityMask);
if (!CreateThread(pfn, NULL))
printf("Error: CreateThread() failed\n");
return true;
return false;
inline uint32_t ByteReverse(uint32_t value)
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment