diff --git a/src/os/unix/unix.cpp b/src/os/unix/unix.cpp index 9e99cbee57..8ca3db7692 100644 --- a/src/os/unix/unix.cpp +++ b/src/os/unix/unix.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef WITH_SDL2 #include @@ -47,10 +48,6 @@ #include #endif -#ifndef NO_THREADS -#include -#endif - #if defined(__APPLE__) # include "../macosx/macos.h" #endif @@ -258,11 +255,9 @@ void OSOpenBrowser(const char *url) #endif /* __APPLE__ */ void SetCurrentThreadName(const char *threadName) { -#if !defined(NO_THREADS) && defined(__GLIBC__) -#if __GLIBC_PREREQ(2, 12) +#if defined(__GLIBC__) if (threadName) pthread_setname_np(pthread_self(), threadName); -#endif /* __GLIBC_PREREQ(2, 12) */ -#endif /* !defined(NO_THREADS) && defined(__GLIBC__) */ +#endif /* defined(__GLIBC__) */ #if defined(__APPLE__) MacOSSetThreadName(threadName); #endif /* defined(__APPLE__) */ diff --git a/src/thread.h b/src/thread.h index 24f4f8e2aa..67140644c7 100644 --- a/src/thread.h +++ b/src/thread.h @@ -45,7 +45,6 @@ void SetCurrentThreadName(const char *name); template inline bool StartNewThread(std::thread *thr, const char *name, TFn&& _Fx, TArgs&&... _Ax) { -#ifndef NO_THREADS try { static std::mutex thread_startup_mutex; std::lock_guard lock(thread_startup_mutex); @@ -79,7 +78,6 @@ inline bool StartNewThread(std::thread *thr, const char *name, TFn&& _Fx, TArgs& /* Something went wrong, the system we are running on might not support threads. */ Debug(misc, 1, "Can't create thread '{}': {}", name, e.what()); } -#endif return false; }