diff options
| author | 2019-03-30 20:10:32 -0400 | |
|---|---|---|
| committer | 2019-03-30 20:10:32 -0400 | |
| commit | a89266bc5e98ba840ed11a9080fa9c85cc8f2cba (patch) | |
| tree | f2581f9f4af0f0f5ecd4c6d40e83f1bd7b8a5d3c /src/common/thread.cpp | |
| parent | Merge pull request #2297 from lioncash/reorder (diff) | |
| parent | common/thread: Remove unused functions (diff) | |
| download | yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar.gz yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.tar.xz yuzu-a89266bc5e98ba840ed11a9080fa9c85cc8f2cba.zip | |
Merge pull request #2303 from lioncash/thread
common/thread: Remove unused functions
Diffstat (limited to 'src/common/thread.cpp')
| -rw-r--r-- | src/common/thread.cpp | 37 |
1 files changed, 0 insertions, 37 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 { | |||
| 27 | 27 | ||
| 28 | #ifdef _MSC_VER | 28 | #ifdef _MSC_VER |
| 29 | 29 | ||
| 30 | void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) { | ||
| 31 | SetThreadAffinityMask(thread, mask); | ||
| 32 | } | ||
| 33 | |||
| 34 | void SetCurrentThreadAffinity(u32 mask) { | ||
| 35 | SetThreadAffinityMask(GetCurrentThread(), mask); | ||
| 36 | } | ||
| 37 | |||
| 38 | void SwitchCurrentThread() { | ||
| 39 | SwitchToThread(); | ||
| 40 | } | ||
| 41 | |||
| 42 | // Sets the debugger-visible name of the current thread. | 30 | // Sets the debugger-visible name of the current thread. |
| 43 | // Uses undocumented (actually, it is now documented) trick. | 31 | // Uses undocumented (actually, it is now documented) trick. |
| 44 | // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtsksettingthreadname.asp | 32 | // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtsksettingthreadname.asp |
| @@ -70,31 +58,6 @@ void SetCurrentThreadName(const char* name) { | |||
| 70 | 58 | ||
| 71 | #else // !MSVC_VER, so must be POSIX threads | 59 | #else // !MSVC_VER, so must be POSIX threads |
| 72 | 60 | ||
| 73 | void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) { | ||
| 74 | #ifdef __APPLE__ | ||
| 75 | thread_policy_set(pthread_mach_thread_np(thread), THREAD_AFFINITY_POLICY, (integer_t*)&mask, 1); | ||
| 76 | #elif (defined __linux__ || defined __FreeBSD__) && !(defined ANDROID) | ||
| 77 | cpu_set_t cpu_set; | ||
| 78 | CPU_ZERO(&cpu_set); | ||
| 79 | |||
| 80 | for (int i = 0; i != sizeof(mask) * 8; ++i) | ||
| 81 | if ((mask >> i) & 1) | ||
| 82 | CPU_SET(i, &cpu_set); | ||
| 83 | |||
| 84 | pthread_setaffinity_np(thread, sizeof(cpu_set), &cpu_set); | ||
| 85 | #endif | ||
| 86 | } | ||
| 87 | |||
| 88 | void SetCurrentThreadAffinity(u32 mask) { | ||
| 89 | SetThreadAffinity(pthread_self(), mask); | ||
| 90 | } | ||
| 91 | |||
| 92 | #ifndef _WIN32 | ||
| 93 | void SwitchCurrentThread() { | ||
| 94 | usleep(1000 * 1); | ||
| 95 | } | ||
| 96 | #endif | ||
| 97 | |||
| 98 | // MinGW with the POSIX threading model does not support pthread_setname_np | 61 | // MinGW with the POSIX threading model does not support pthread_setname_np |
| 99 | #if !defined(_WIN32) || defined(_MSC_VER) | 62 | #if !defined(_WIN32) || defined(_MSC_VER) |
| 100 | void SetCurrentThreadName(const char* name) { | 63 | void SetCurrentThreadName(const char* name) { |