pthread_setaffinity_np: better error reporting

metadata
Wenzel Jakob 2014-07-01 16:08:04 +02:00
parent 641f0a96dd
commit a1eecbb55a
1 changed files with 3 additions and 2 deletions

View File

@ -339,8 +339,9 @@ void Thread::setCoreAffinity(int coreID) {
}
const pthread_t threadID = d->thread.native_handle();
if (pthread_setaffinity_np(threadID, size, cpuset) != 0)
Log(EWarn, "Thread::setCoreAffinity(): pthread_setaffinity_np: failed");
int retval = pthread_setaffinity_np(threadID, size, cpuset);
if (retval)
Log(EWarn, "Thread::setCoreAffinity(): pthread_setaffinity_np: failed: %s", strerror(errno));
CPU_FREE(cpuset);
#elif defined(__WINDOWS__)
int nCores = getCoreCount();