32 #ifdef OVR_ENABLE_THREADS
35 #if defined(OVR_OS_WIN32) && defined(NTDDI_WIN8) && (NTDDI_VERSION >= NTDDI_WIN8)
44 #if defined(OVR_OS_WIN32)
51 #if defined(NTDDI_WIN8) && (NTDDI_VERSION >= NTDDI_WIN8)
53 InitializeCriticalSectionEx(&cs, spinCount,
57 typedef BOOL (WINAPI *Function_InitializeCriticalSectionAndSpinCount)
58 (LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount);
63 static bool initTried = 0;
64 static Function_InitializeCriticalSectionAndSpinCount pInitFn = 0;
68 HMODULE hmodule = ::LoadLibrary(OVR_STR(
"kernel32.dll"));
69 pInitFn = (Function_InitializeCriticalSectionAndSpinCount)
70 ::GetProcAddress(hmodule,
"InitializeCriticalSectionAndSpinCount");
76 pInitFn(&cs, spinCount);
78 ::InitializeCriticalSection(&cs);
86 DeleteCriticalSection(&cs);
113 if (oldUseCount == 0)
142 if (oldUseCount == 1)
162 #endif // OVR_ENABLE_THREADS
void ReleaseLock(Lock *plock)
#define OVR_DEBUG_SELECT(d, nd)
UInt64 Buffer[(sizeof(Lock)+sizeof(UInt64)-1)/sizeof(UInt64)]