diff options
| author | Martin Ridgers <[email protected]> | 2021-12-15 15:27:12 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-16 09:35:51 +0100 |
| commit | 920c0845d299e4c5c2a8b5cfe4dcc3a99c35e87b (patch) | |
| tree | 3ba2e9e2a8adf1b13f084ddad913edf670581084 /zencore/thread.cpp | |
| parent | Added MD5 tests (diff) | |
| download | zen-920c0845d299e4c5c2a8b5cfe4dcc3a99c35e87b.tar.xz zen-920c0845d299e4c5c2a8b5cfe4dcc3a99c35e87b.zip | |
Thread naming for Mac
Diffstat (limited to 'zencore/thread.cpp')
| -rw-r--r-- | zencore/thread.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp index 6d17e6968..9e35e5d57 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -88,8 +88,12 @@ SetCurrentThreadName([[maybe_unused]] std::string_view ThreadName) SetNameInternal(GetCurrentThreadId(), ThreadNameZ.c_str()); #else std::string ThreadNameZ{ThreadName}; +#if ZEN_PLATFORM_MAC + pthread_setname_np(ThreadNameZ.c_str()); +#else pthread_setname_np(pthread_self(), ThreadNameZ.c_str()); #endif +#endif } // namespace zen void |