mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
hsbench: cpuset portability
This commit is contained in:
parent
79b42cff58
commit
f739314696
@ -125,10 +125,10 @@ public:
|
|||||||
// Apply processor affinity (if available) to this thread.
|
// Apply processor affinity (if available) to this thread.
|
||||||
bool affine(UNUSED int cpu) {
|
bool affine(UNUSED int cpu) {
|
||||||
#ifdef HAVE_DECL_PTHREAD_SETAFFINITY_NP
|
#ifdef HAVE_DECL_PTHREAD_SETAFFINITY_NP
|
||||||
#if defined(__linux__)
|
#if defined(__FreeBSD__)
|
||||||
cpu_set_t cpuset;
|
|
||||||
#else // BSD
|
|
||||||
cpuset_t cpuset;
|
cpuset_t cpuset;
|
||||||
|
#else
|
||||||
|
cpu_set_t cpuset;
|
||||||
#endif
|
#endif
|
||||||
CPU_ZERO(&cpuset);
|
CPU_ZERO(&cpuset);
|
||||||
assert(cpu >= 0 && cpu < CPU_SETSIZE);
|
assert(cpu >= 0 && cpu < CPU_SETSIZE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user