1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

fix thread naming on windows

This commit is contained in:
Rick V 2019-08-01 23:42:32 -05:00
parent c5aaefa7e7
commit 8cf5f2c9a5

View file

@ -32,7 +32,7 @@ namespace llarp
// API present upstream since v2.11.3 and imported downstream
// in CR 8158 <https://www.illumos.org/issues/8158>
// We only use the native function on Microsoft C++ builds
#elif defined(__linux__) || defined(__sun) || defined(__MINGW32__)
#elif defined(__linux__) || defined(__sun)
const int rc = pthread_setname_np(pthread_self(), name.c_str());
#else
#error "unsupported platform"
@ -45,6 +45,8 @@ namespace llarp
#endif
#elif _MSC_VER
::SetThreadName(::GetCurrentThreadId(), name.c_str());
#elif __MINGW32__
const int rc = pthread_setname_np(pthread_self(), name.c_str());
#else
LogInfo("Thread name setting not supported on this platform");
(void)name;