Index: src/utils/SkThreadUtils_win.cpp |
diff --git a/src/utils/SkThreadUtils_win.cpp b/src/utils/SkThreadUtils_win.cpp |
index a5efb939f33254d4b7dd7c87d294f5bc532f0e70..07cceee14218ec629d1da7e38c82b1e47cb473bc 100644 |
--- a/src/utils/SkThreadUtils_win.cpp |
+++ b/src/utils/SkThreadUtils_win.cpp |
@@ -53,7 +53,7 @@ SkThread::SkThread(entryPointProc entryPoint, void* data) { |
0, // use default stack size |
thread_start, // thread function name (proxy) |
winData, // argument to thread function (proxy args) |
- CREATE_SUSPENDED, // create suspended so affinity can be set |
+ CREATE_SUSPENDED, // we used to set processor affinity, which needed this |
&winData->fThreadId); // returns the thread identifier |
} |
@@ -96,41 +96,3 @@ void SkThread::join() { |
WaitForSingleObject(winData->fHandle, INFINITE); |
} |
- |
-static unsigned int num_bits_set(DWORD_PTR mask) { |
- unsigned int count; |
- for (count = 0; mask; ++count) { |
- mask &= mask - 1; |
- } |
- return count; |
-} |
- |
-static unsigned int nth_set_bit(unsigned int n, DWORD_PTR mask) { |
- n %= num_bits_set(mask); |
- for (unsigned int setBitsSeen = 0, currentBit = 0; true; ++currentBit) { |
- if (mask & (static_cast<DWORD_PTR>(1) << currentBit)) { |
- ++setBitsSeen; |
- if (setBitsSeen > n) { |
- return currentBit; |
- } |
- } |
- } |
-} |
- |
-bool SkThread::setProcessorAffinity(unsigned int processor) { |
- SkThread_WinData* winData = static_cast<SkThread_WinData*>(fData); |
- if (nullptr == winData->fHandle) { |
- return false; |
- } |
- |
- DWORD_PTR processAffinityMask; |
- DWORD_PTR systemAffinityMask; |
- if (0 == GetProcessAffinityMask(GetCurrentProcess(), |
- &processAffinityMask, |
- &systemAffinityMask)) { |
- return false; |
- } |
- |
- DWORD_PTR threadAffinityMask = 1 << nth_set_bit(processor, processAffinityMask); |
- return 0 != SetThreadAffinityMask(winData->fHandle, threadAffinityMask); |
-} |