1#ifdef PL_MUTEX_WIN_INL_H_INCLUDED
2# error "This file must not be included twice."
5#define PL_MUTEX_WIN_INL_H_INCLUDED
7#if PL_ENABLED(PL_COMPILER_MSVC) && PL_ENABLED(PL_PLATFORM_ARCH_X86)
15 __declspec(dllimport)
void __stdcall plWinEnterCriticalSection(plMutexHandle* handle);
16 __declspec(dllimport)
void __stdcall plWinLeaveCriticalSection(plMutexHandle* handle);
17 __declspec(dllimport) plMinWindows::BOOL __stdcall plWinTryEnterCriticalSection(plMutexHandle* handle);
20# if PL_ENABLED(PL_PLATFORM_32BIT)
21# pragma comment(linker, "/alternatename:__imp__plWinEnterCriticalSection@4=__imp__EnterCriticalSection@4")
22# pragma comment(linker, "/alternatename:__imp__plWinLeaveCriticalSection@4=__imp__LeaveCriticalSection@4")
23# pragma comment(linker, "/alternatename:__imp__plWinTryEnterCriticalSection@4=__imp__TryEnterCriticalSection@4")
25# pragma comment(linker, "/alternatename:__imp_plWinEnterCriticalSection=__imp_EnterCriticalSection")
26# pragma comment(linker, "/alternatename:__imp_plWinLeaveCriticalSection=__imp_LeaveCriticalSection")
27# pragma comment(linker, "/alternatename:__imp_plWinTryEnterCriticalSection=__imp_TryEnterCriticalSection")
33 plWinEnterCriticalSection(&m_hHandle);
40 plWinLeaveCriticalSection(&m_hHandle);
45 if (plWinTryEnterCriticalSection(&m_hHandle) != 0)
56# include <Foundation/Basics/Platform/Win/IncludeWindows.h>
60 EnterCriticalSection((CRITICAL_SECTION*)&m_hHandle);
67 LeaveCriticalSection((CRITICAL_SECTION*)&m_hHandle);
72 if (TryEnterCriticalSection((CRITICAL_SECTION*)&m_hHandle) != 0)
void Unlock()
Releases a lock that has been previously acquired.
Definition Mutex_posix.h:34
plResult TryLock()
Attempts to acquire an exclusive lock for this mutex object. Returns true on success.
Definition Mutex_posix.h:24
void Lock()
Acquires an exclusive lock for this mutex object.
Definition Mutex_posix.h:18
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54