diff options
author | Sven Gothel <sgothel@jausoft.com> | 2023-11-28 12:51:46 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2023-11-28 12:51:46 +0100 |
commit | 1aaf4f070011490bcece50394b9b32dfa593fd9e (patch) | |
tree | 17d68284e401a35eea3d3a574d986d446a60763a /common/threads.h | |
parent | 6e7cee4fa9a8af03f28ca26cd89f8357390dfc90 (diff) | |
parent | 571b546f35eead77ce109f8d4dd6c3de3199d573 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'common/threads.h')
-rw-r--r-- | common/threads.h | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/common/threads.h b/common/threads.h deleted file mode 100644 index 1cdb5d8f..00000000 --- a/common/threads.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef AL_THREADS_H -#define AL_THREADS_H - -#if defined(__GNUC__) && defined(__i386__) -/* force_align_arg_pointer is required for proper function arguments aligning - * when SSE code is used. Some systems (Windows, QNX) do not guarantee our - * thread functions will be properly aligned on the stack, even though GCC may - * generate code with the assumption that it is. */ -#define FORCE_ALIGN __attribute__((force_align_arg_pointer)) -#else -#define FORCE_ALIGN -#endif - -#if defined(__APPLE__) -#include <dispatch/dispatch.h> -#elif !defined(_WIN32) -#include <semaphore.h> -#endif - -void althrd_setname(const char *name); - -namespace al { - -class semaphore { -#ifdef _WIN32 - using native_type = void*; -#elif defined(__APPLE__) - using native_type = dispatch_semaphore_t; -#else - using native_type = sem_t; -#endif - native_type mSem; - -public: - semaphore(unsigned int initial=0); - semaphore(const semaphore&) = delete; - ~semaphore(); - - semaphore& operator=(const semaphore&) = delete; - - void post(); - void wait() noexcept; - bool try_wait() noexcept; -}; - -} // namespace al - -#endif /* AL_THREADS_H */ |