Chromium Code Reviews| Index: src/utils/SkThreadUtils_pthread_linux.cpp |
| diff --git a/src/utils/SkThreadUtils_pthread_linux.cpp b/src/utils/SkThreadUtils_pthread_linux.cpp |
| index 4a03cb8276d9144142aeaae4ecfb52e5d1aa32dd..769595d4ced9ea70b6ad5e33a07fb04329766fdc 100644 |
| --- a/src/utils/SkThreadUtils_pthread_linux.cpp |
| +++ b/src/utils/SkThreadUtils_pthread_linux.cpp |
| @@ -13,6 +13,25 @@ |
| #include "SkThreadUtils_pthread.h" |
| #include <pthread.h> |
| +#ifdef __FreeBSD__ |
| +#include <pthread_np.h> |
| +#endif |
| + |
| +#if defined(__FreeBSD__) || defined(__NetBSD__) |
| +#define cpu_set_t cpuset_t |
|
bungeman-skia
2013/08/06 20:44:12
isn't this what typedef is for?
|
| +#endif |
| + |
| +#ifndef CPU_COUNT |
| +static int CPU_COUNT(cpu_set_t *set) { |
| + int count = 0; |
| + for (int i = 0; i < CPU_SETSIZE; i++) { |
| + if (CPU_ISSET(i, set)) { |
| + count++; |
| + } |
| + } |
| + return count; |
| +} |
| +#endif /* !CPU_COUNT */ |
| static int nth_set_cpu(unsigned int n, cpu_set_t* cpuSet) { |
| n %= CPU_COUNT(cpuSet); |