pthread_setaffinity_np: better error reporting
parent
641f0a96dd
commit
a1eecbb55a
|
@ -339,8 +339,9 @@ void Thread::setCoreAffinity(int coreID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const pthread_t threadID = d->thread.native_handle();
|
const pthread_t threadID = d->thread.native_handle();
|
||||||
if (pthread_setaffinity_np(threadID, size, cpuset) != 0)
|
int retval = pthread_setaffinity_np(threadID, size, cpuset);
|
||||||
Log(EWarn, "Thread::setCoreAffinity(): pthread_setaffinity_np: failed");
|
if (retval)
|
||||||
|
Log(EWarn, "Thread::setCoreAffinity(): pthread_setaffinity_np: failed: %s", strerror(errno));
|
||||||
CPU_FREE(cpuset);
|
CPU_FREE(cpuset);
|
||||||
#elif defined(__WINDOWS__)
|
#elif defined(__WINDOWS__)
|
||||||
int nCores = getCoreCount();
|
int nCores = getCoreCount();
|
||||||
|
|
Loading…
Reference in New Issue