Commit 11cb2392 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Skip setting affinity if you detect execution under CircleCI.

parent 4a9ef953
......@@ -403,11 +403,16 @@ pthread_t __po_hi_posix_create_thread (__po_hi_priority_t priority,
CPU_ZERO(&cpuset);
CPU_SET(core_id, &cpuset);
if (pthread_attr_setaffinity_np(&attr, sizeof(cpuset), &cpuset) != 0)
/* Under CircleCI, affinity setting makes a thread that can't be spawned! */
/* So skip calling setaffinity if you detect this environment.. */
/* We are already in __linux__ #ifdef scope, so this run-time check should work. */
if ( NULL == getenv("CIRCLECI")) {
if (pthread_attr_setaffinity_np(&attr, sizeof(cpuset), &cpuset) != 0)
{
__DEBUGMSG("CANNOT SET AFFINTY\n");
return ((pthread_t)__PO_HI_ERROR_PTHREAD_ATTR);
}
}
#else
#warning pthread_affinity managmeent disabled for Compcert
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment