diff options
author | Jeff Garzik <jeff@garzik.org> | 2012-04-12 13:24:00 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2012-04-12 13:24:00 -0400 |
commit | 460b66b14b80a55279d837c91aff1f1c3ca60d7f (patch) | |
tree | 7eaf5471f73a885e8f4734269c7626886d5b9de8 | |
parent | 940e22fd81af29dee6c07e413de1b446a21712b0 (diff) | |
download | bitcoin-460b66b14b80a55279d837c91aff1f1c3ca60d7f.tar.xz |
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.
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/util.h | 20 |
2 files changed, 0 insertions, 22 deletions
diff --git a/src/main.cpp b/src/main.cpp index b9c9db7a62..bdafae8eb8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3361,8 +3361,6 @@ void static BitcoinMiner(CWallet *pwallet) while (fGenerateBitcoins) { - if (AffinityBugWorkaround(ThreadBitcoinMiner)) - return; if (fShutdown) return; while (vNodes.empty() || IsInitialBlockDownload()) diff --git a/src/util.h b/src/util.h index d205260d8e..f6cb3caa1d 100644 --- a/src/util.h +++ b/src/util.h @@ -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; - } -#endif - return false; -} - inline uint32_t ByteReverse(uint32_t value) { value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); |