vkd3d: Eliminate HAVE_PTHREAD_H
Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
parent
e34eb3bf0f
commit
1f266cc16b
|
@ -19,13 +19,9 @@
|
||||||
#ifndef __VKD3D_THREADS_H
|
#ifndef __VKD3D_THREADS_H
|
||||||
#define __VKD3D_THREADS_H
|
#define __VKD3D_THREADS_H
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "vkd3d_memory.h"
|
#include "vkd3d_memory.h"
|
||||||
|
|
||||||
#if defined(HAVE_PTHREAD_H)
|
#if defined(_WIN32)
|
||||||
#include <pthread.h>
|
|
||||||
|
|
||||||
#elif defined(_WIN32) /* HAVE_PTHREAD_H */
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -147,21 +143,20 @@ static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *lock)
|
||||||
return ret ? 0 : -1;
|
return ret ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* HAVE_PTHREAD_H */
|
|
||||||
#error "Threads are not supported. Cannot build."
|
|
||||||
#endif /* HAVE_PTHREAD_H */
|
|
||||||
|
|
||||||
static inline void vkd3d_set_thread_name(const char *name)
|
static inline void vkd3d_set_thread_name(const char *name)
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER)
|
|
||||||
(void)name;
|
(void)name;
|
||||||
#elif defined(HAVE_PTHREAD_SETNAME_NP_2)
|
|
||||||
pthread_setname_np(pthread_self(), name);
|
|
||||||
#elif defined(HAVE_PTHREAD_SETNAME_NP_1)
|
|
||||||
pthread_setname_np(name);
|
|
||||||
#else
|
|
||||||
(void)name;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#elif defined(__linux__)
|
||||||
|
#include <pthread.h>
|
||||||
|
static inline void vkd3d_set_thread_name(const char *name)
|
||||||
|
{
|
||||||
|
pthread_setname_np(pthread_self(), name);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#error "Threads are not supported. Cannot build."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __VKD3D_THREADS_H */
|
#endif /* __VKD3D_THREADS_H */
|
||||||
|
|
Loading…
Reference in New Issue