diff options
| author | 2016-10-10 02:25:19 +0000 | |
|---|---|---|
| committer | 2016-10-27 23:28:29 +0000 | |
| commit | 1410bd3bd03f057a96348c9167bb7f5c0cb3b0de (patch) | |
| tree | f525cae86ff529deff3c571d6c1e71856b2499f8 /src/common/thread.cpp | |
| parent | hooks: convert pre-commit to POSIX syntax (diff) | |
| download | yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar.gz yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.tar.xz yuzu-1410bd3bd03f057a96348c9167bb7f5c0cb3b0de.zip | |
common: define routines to set thread name on more BSDs
src/common/thread.cpp:123:5: error: use of undeclared identifier 'pthread_setname_np'
pthread_setname_np(pthread_self(), szThreadName);
^
1 error generated.
Diffstat (limited to 'src/common/thread.cpp')
| -rw-r--r-- | src/common/thread.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/thread.cpp b/src/common/thread.cpp index 6e7b39b9a..a4f5fa336 100644 --- a/src/common/thread.cpp +++ b/src/common/thread.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #elif defined(_WIN32) | 8 | #elif defined(_WIN32) |
| 9 | #include <Windows.h> | 9 | #include <Windows.h> |
| 10 | #else | 10 | #else |
| 11 | #if defined(BSD4_4) || defined(__OpenBSD__) | 11 | #if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) |
| 12 | #include <pthread_np.h> | 12 | #include <pthread_np.h> |
| 13 | #else | 13 | #else |
| 14 | #include <pthread.h> | 14 | #include <pthread.h> |
| @@ -117,8 +117,10 @@ void SwitchCurrentThread() { | |||
| 117 | void SetCurrentThreadName(const char* szThreadName) { | 117 | void SetCurrentThreadName(const char* szThreadName) { |
| 118 | #ifdef __APPLE__ | 118 | #ifdef __APPLE__ |
| 119 | pthread_setname_np(szThreadName); | 119 | pthread_setname_np(szThreadName); |
| 120 | #elif defined(__OpenBSD__) | 120 | #elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) |
| 121 | pthread_set_name_np(pthread_self(), szThreadName); | 121 | pthread_set_name_np(pthread_self(), szThreadName); |
| 122 | #elif defined(__NetBSD__) | ||
| 123 | pthread_setname_np(pthread_self(), "%s", (void*)szThreadName); | ||
| 122 | #else | 124 | #else |
| 123 | pthread_setname_np(pthread_self(), szThreadName); | 125 | pthread_setname_np(pthread_self(), szThreadName); |
| 124 | #endif | 126 | #endif |