mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Fix setThreadName support for BSD
This commit is contained in:
		@@ -285,12 +285,19 @@ inline u32 getTime(TimePrecision prec)
 | 
			
		||||
		 */
 | 
			
		||||
		prctl(PR_SET_NAME, name);
 | 
			
		||||
	}
 | 
			
		||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 | 
			
		||||
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
 | 
			
		||||
	#include <pthread.h>
 | 
			
		||||
	#include <pthread_np.h>
 | 
			
		||||
 | 
			
		||||
	inline void setThreadName(const char *name) {
 | 
			
		||||
		pthread_set_name_np(pthread_self(), name);
 | 
			
		||||
	}
 | 
			
		||||
#elif defined(__NetBSD__)
 | 
			
		||||
	#include <pthread.h>
 | 
			
		||||
 | 
			
		||||
	inline void setThreadName(const char *name) {
 | 
			
		||||
		pthread_setname_np(pthread_self(), name);
 | 
			
		||||
	}
 | 
			
		||||
#elif defined(_MSC_VER)
 | 
			
		||||
	typedef struct tagTHREADNAME_INFO {
 | 
			
		||||
		DWORD dwType; // must be 0x1000
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user