Browse Source

fix gettid call for glibc

tags/20180830
Diego Gomes nihui 7 years ago
parent
commit
4d73407df8
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/cpu.cpp

+ 4
- 1
src/cpu.cpp View File

@@ -308,8 +308,11 @@ typedef struct
memset((cpusetp), 0, sizeof(cpu_set_t))

// set affinity for thread
#ifdef __GLIBC__
pid_t pid = syscall(SYS_gettid);

#else
pid_t pid = gettid();
#endif
cpu_set_t mask;
CPU_ZERO(&mask);
for (int i=0; i<(int)cpuids.size(); i++)


Loading…
Cancel
Save