diff options
author | Chris Robinson <[email protected]> | 2023-06-01 18:16:17 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-06-01 18:16:17 -0700 |
commit | 2b7ab0b75086f3d73a7ffe9bc05a80e5d9c625f5 (patch) | |
tree | 49c532388826c07d21b0a7b9d206d5356095228c /common/threads.h | |
parent | c200eb73a7cf47dbd1a4a3785be471adfb3513d8 (diff) |
Rename threads.cpp/h to alsem.cpp/h
Diffstat (limited to 'common/threads.h')
-rw-r--r-- | common/threads.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/common/threads.h b/common/threads.h deleted file mode 100644 index 703d50d4..00000000 --- a/common/threads.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef AL_THREADS_H -#define AL_THREADS_H - -#if defined(__APPLE__) -#include <AvailabilityMacros.h> -#include <TargetConditionals.h> -#if (((MAC_OS_X_VERSION_MIN_REQUIRED > 1050) && !defined(__ppc__)) || TARGET_OS_IOS || TARGET_OS_TV) -#include <dispatch/dispatch.h> -#define AL_APPLE_HAVE_DISPATCH 1 -#else -#include <semaphore.h> /* Fallback option for Apple without a working libdispatch */ -#endif -#elif !defined(_WIN32) -#include <semaphore.h> -#endif - -namespace al { - -class semaphore { -#ifdef _WIN32 - using native_type = void*; -#elif defined(AL_APPLE_HAVE_DISPATCH) - 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 */ |