| 30 | } |
| 31 | |
| 32 | bool setThreadAffinity(const AffinityMask& mask) |
| 33 | { |
| 34 | cpu_set_t cpuSet; |
| 35 | CPU_ZERO(&cpuSet); |
| 36 | |
| 37 | for (size_t i = 0; i < mask.size(); ++i) |
| 38 | { |
| 39 | if (mask.test(i)) |
| 40 | CPU_SET(i, &cpuSet); |
| 41 | } |
| 42 | |
| 43 | return pthread_setaffinity_np(pthread_self(), sizeof(cpuSet), &cpuSet) == 0; |
| 44 | } |
| 45 | |
| 46 | AffinityMask getThreadAffinity() |
| 47 | { |
nothing calls this directly
no test coverage detected