42 lines
1.4 KiB
C++
42 lines
1.4 KiB
C++
/***
|
|
Copyright (C) 2024 Jamie Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AuWoASemaphore.hpp
|
|
Date: 2024-1-22
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
#if defined(AURORA_IS_LINUX_DERIVED)
|
|
|
|
// Should use
|
|
#define WOA_SEMAPHORE_MODE
|
|
|
|
#elif defined(AURORA_IS_XNU_DERIVED)
|
|
|
|
// Must use libdispatch semaphores
|
|
#define WOA_SEMAPHORE_MODE
|
|
|
|
#define WOA_SEMAPHORE_SEMAPHORE Aurora::Threading::Primitives::WoASemaphoreImpl
|
|
|
|
#include "AuWoASemaphore.Unix.hpp"
|
|
|
|
#elif defined(AURORA_IS_POSIX_DERIVED)
|
|
|
|
// Probably not worth it?
|
|
//#define WOA_SEMAPHORE_MODE
|
|
|
|
#define WOA_SEMAPHORE_SEMAPHORE Aurora::Threading::Primitives::WoASemaphoreImpl
|
|
#define WOA_CONDVAR_MUTEX Aurora::Threading::Primitives::WoAConditionMutex
|
|
#define WOA_CONDVAR_VARIABLE Aurora::Threading::Primitives::WoAConditionVariable
|
|
|
|
#include "AuWoASemaphore.Unix.hpp"
|
|
|
|
#endif
|
|
|
|
// Win32: N/A (simply use the win32 primitives built on top of the native kernelbase waitonaddress or keyed events)
|
|
// Linux: N/A (simply use the linux primitives built on top of Aurora::futex_[...] wrappers, in semaphore mode)
|
|
// Xbox Original/360 homebrew: Port using WOA_SEMAPHORE_SEMAPHORE behind CreateSemphore
|
|
// Win 2000 and Win9x: Port using WOA_SEMAPHORE_SEMAPHORE behind CreateSemphore
|
|
// Other microkernels: Port using WOA_SEMAPHORE_SEMAPHORE
|
|
// POSIX: experiment with WOA_SEMAPHORE_MODE turned on or off
|