[*] An MSVC bug, but not really.

This commit is contained in:
Reece Wilson 2023-12-30 00:15:19 +00:00
parent 063aa5c548
commit ba6162a7ad

View File

@ -8,14 +8,16 @@
#pragma once
#include "AuMutex.Generic.hpp"
#include "AuConditionMutex.Generic.hpp"
#include "ThreadCookie.hpp"
#if defined(AURORA_IS_LINUX_DERIVED)
#include "AuConditionMutex.Linux.hpp"
#endif
namespace Aurora::Threading::Primitives
{
#if (defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86))
#pragma pack(push)
#pragma pack(4)
#endif
struct CriticalSectionImpl final : IWaitable
{
CriticalSectionImpl();
@ -32,7 +34,9 @@ namespace Aurora::Threading::Primitives
void Unlock() override;
private:
#if defined(AURORA_IS_LINUX_DERIVED)
#if defined(_AURUNTIME_GENERICCM)
GenericConditionMutex mutex_;
#elif defined(AURORA_IS_LINUX_DERIVED)
LinuxConditionMutex mutex_; // shave a few bytes
#else
MutexImpl mutex_;
@ -40,4 +44,8 @@ namespace Aurora::Threading::Primitives
ThreadCookie_t owner_;
AuUInt32 count_;
};
#if (defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86))
#pragma pack(pop)
#endif
}