diff options
Diffstat (limited to 'Source/Core/Common/Thread.cpp')
| -rw-r--r-- | Source/Core/Common/Thread.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/Common/Thread.cpp b/Source/Core/Common/Thread.cpp index fb091ee2a7..1e60fbb29f 100644 --- a/Source/Core/Common/Thread.cpp +++ b/Source/Core/Common/Thread.cpp @@ -8,7 +8,7 @@ #ifdef __APPLE__ #include <mach/mach.h> -#elif defined BSD4_4 +#elif defined BSD4_4 || defined __FreeBSD__ #include <pthread_np.h> #endif @@ -94,8 +94,12 @@ void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) #ifdef __APPLE__ thread_policy_set(pthread_mach_thread_np(thread), THREAD_AFFINITY_POLICY, (integer_t *)&mask, 1); -#elif (defined __linux__ || defined BSD4_4) && !(defined ANDROID) +#elif (defined __linux__ || defined BSD4_4 || defined __FreeBSD__) && !(defined ANDROID) +#ifdef __FreeBSD__ + cpuset_t cpu_set; +#else cpu_set_t cpu_set; +#endif CPU_ZERO(&cpu_set); for (int i = 0; i != sizeof(mask) * 8; ++i) @@ -125,6 +129,8 @@ void SetCurrentThreadName(const char* szThreadName) { #ifdef __APPLE__ pthread_setname_np(szThreadName); +#elif defined __FreeBSD__ + pthread_set_name_np(pthread_self(), szThreadName); #else pthread_setname_np(pthread_self(), szThreadName); #endif |
