| 115 | } |
| 116 | |
| 117 | void ThreadAffinity::restore(int threadIndex) |
| 118 | { |
| 119 | if (threadIndex >= (int)affinities.size()) |
| 120 | return; |
| 121 | |
| 122 | // Restore the original affinity |
| 123 | const HANDLE thread = GetCurrentThread(); |
| 124 | if (!pSetThreadGroupAffinity(thread, &oldAffinities[threadIndex], nullptr)) |
| 125 | printWarning("SetThreadGroupAffinity failed"); |
| 126 | } |
| 127 | |
| 128 | #elif defined(__linux__) |
| 129 |
no test coverage detected