8#ifndef INCLUDED_BSLS_BSLLOCKIMPL_WIN32
9#define INCLUDED_BSLS_BSLLOCKIMPL_WIN32
66#include <bsls_platform.h>
68#ifdef BSLS_PLATFORM_OS_WINDOWS
73struct _RTL_CRITICAL_SECTION;
75typedef struct _RTL_CRITICAL_SECTION CRITICAL_SECTION, *LPCRITICAL_SECTION;
77typedef unsigned long DWORD;
80 __declspec(dllimport) BOOL __stdcall InitializeCriticalSectionAndSpinCount(
81 LPCRITICAL_SECTION lpCriticalSection,
84 __declspec(dllimport)
void __stdcall DeleteCriticalSection(
85 LPCRITICAL_SECTION lpCriticalSection);
87 __declspec(dllimport)
void __stdcall EnterCriticalSection(
88 LPCRITICAL_SECTION lpCriticalSection);
90 __declspec(dllimport)
void __stdcall LeaveCriticalSection(
91 LPCRITICAL_SECTION lpCriticalSection);
102class BslLockImpl_win32 {
115#ifdef BSLS_PLATFORM_CPU_64_BIT
117 k_CRITICAL_SECTION_BUFFER_SIZE = 5
120 k_CRITICAL_SECTION_BUFFER_SIZE = 6
134 void *d_lock[k_CRITICAL_SECTION_BUFFER_SIZE];
137 BslLockImpl_win32(
const BslLockImpl_win32&);
138 BslLockImpl_win32& operator=(
const BslLockImpl_win32&);
145 ~BslLockImpl_win32();
175BslLockImpl_win32::BslLockImpl_win32()
177 InitializeCriticalSectionAndSpinCount(
178 reinterpret_cast<_RTL_CRITICAL_SECTION *
>(d_lock), k_SPIN_COUNT);
182BslLockImpl_win32::~BslLockImpl_win32()
184 DeleteCriticalSection(
185 reinterpret_cast<_RTL_CRITICAL_SECTION*
>(d_lock));
190void BslLockImpl_win32::lock()
192 EnterCriticalSection(
193 reinterpret_cast<_RTL_CRITICAL_SECTION*
>(d_lock));
197void BslLockImpl_win32::unlock()
199 LeaveCriticalSection(
200 reinterpret_cast<_RTL_CRITICAL_SECTION*
>(d_lock));
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691