diff options
author | bunnei <bunneidev@gmail.com> | 2019-03-31 01:10:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-31 01:10:32 +0100 |
commit | a89266bc5e98ba840ed11a9080fa9c85cc8f2cba (patch) | |
tree | f2581f9f4af0f0f5ecd4c6d40e83f1bd7b8a5d3c /src/common | |
parent | Merge pull request #2297 from lioncash/reorder (diff) | |
parent | common/thread: Remove unused functions (diff) | |
download | yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar.gz yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar.bz2 yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar.lz yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar.xz yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar.zst yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/thread.cpp | 37 | ||||
-rw-r--r-- | src/common/thread.h | 4 |
2 files changed, 0 insertions, 41 deletions
diff --git a/src/common/thread.cpp b/src/common/thread.cpp index 5144c0d9f..fe7a420cc 100644 --- a/src/common/thread.cpp +++ b/src/common/thread.cpp @@ -27,18 +27,6 @@ namespace Common { #ifdef _MSC_VER -void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) { - SetThreadAffinityMask(thread, mask); -} - -void SetCurrentThreadAffinity(u32 mask) { - SetThreadAffinityMask(GetCurrentThread(), mask); -} - -void SwitchCurrentThread() { - SwitchToThread(); -} - // Sets the debugger-visible name of the current thread. // Uses undocumented (actually, it is now documented) trick. // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtsksettingthreadname.asp @@ -70,31 +58,6 @@ void SetCurrentThreadName(const char* name) { #else // !MSVC_VER, so must be POSIX threads -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 __FreeBSD__) && !(defined ANDROID) - cpu_set_t cpu_set; - CPU_ZERO(&cpu_set); - - for (int i = 0; i != sizeof(mask) * 8; ++i) - if ((mask >> i) & 1) - CPU_SET(i, &cpu_set); - - pthread_setaffinity_np(thread, sizeof(cpu_set), &cpu_set); -#endif -} - -void SetCurrentThreadAffinity(u32 mask) { - SetThreadAffinity(pthread_self(), mask); -} - -#ifndef _WIN32 -void SwitchCurrentThread() { - usleep(1000 * 1); -} -#endif - // MinGW with the POSIX threading model does not support pthread_setname_np #if !defined(_WIN32) || defined(_MSC_VER) void SetCurrentThreadName(const char* name) { diff --git a/src/common/thread.h b/src/common/thread.h index 2cf74452d..c5fc3533d 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -9,7 +9,6 @@ #include <cstddef> #include <mutex> #include <thread> -#include "common/common_types.h" namespace Common { @@ -78,9 +77,6 @@ private: std::size_t generation = 0; // Incremented once each time the barrier is used }; -void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask); -void SetCurrentThreadAffinity(u32 mask); -void SwitchCurrentThread(); // On Linux, this is equal to sleep 1ms void SetCurrentThreadName(const char* name); } // namespace Common |