Changeset - r27662:63300ecefa7b
[Not reviewed]
master
0 2 0
Rubidium - 12 months ago 2023-06-27 19:28:14
rubidium@openttd.org
Cleanup: unused NO_THREADS #ifdefs
2 files changed with 3 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/os/unix/unix.cpp
Show inline comments
 
@@ -20,6 +20,7 @@
 
#include <sys/stat.h>
 
#include <time.h>
 
#include <signal.h>
 
#include <pthread.h>
 

	
 
#ifdef WITH_SDL2
 
#include <SDL.h>
 
@@ -47,10 +48,6 @@
 
#include <sys/sysctl.h>
 
#endif
 

	
 
#ifndef NO_THREADS
 
#include <pthread.h>
 
#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__) */
src/thread.h
Show inline comments
 
@@ -45,7 +45,6 @@ void SetCurrentThreadName(const char *na
 
template<class TFn, class... TArgs>
 
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<std::mutex> lock(thread_startup_mutex);
 
@@ -79,7 +78,6 @@ inline bool StartNewThread(std::thread *
 
		/* 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;
 
}
0 comments (0 inline, 0 general)