Replace GlobalLock functions with std::mutex
The usage of GetGlobalLock/ReleaseGlobalLock/InitGlobalLock is replaced by std::lock_guard which is available as of c++11, and the functions are removed from the OSDependent ossource.cpp files. The standalone glslang binary now explicitly depends on OSDependent, as nothing in in the glslang library uses those functions anymore and they are not implicitly picked up by the linker.
This commit is contained in:
parent
171a322025
commit
396596ca4a
5 changed files with 10 additions and 82 deletions
|
|
@ -37,11 +37,9 @@
|
|||
#define STRICT
|
||||
#define VC_EXTRALEAN 1
|
||||
#include <windows.h>
|
||||
#include <cassert>
|
||||
#include <process.h>
|
||||
#include <psapi.h>
|
||||
#include <cstdio>
|
||||
#include <cstdint>
|
||||
|
||||
//
|
||||
// This file contains the Window-OS-specific functions
|
||||
|
|
@ -53,28 +51,6 @@
|
|||
|
||||
namespace glslang {
|
||||
|
||||
HANDLE GlobalLock;
|
||||
|
||||
void InitGlobalLock()
|
||||
{
|
||||
GlobalLock = CreateMutex(nullptr, false, nullptr);
|
||||
}
|
||||
|
||||
void GetGlobalLock()
|
||||
{
|
||||
WaitForSingleObject(GlobalLock, INFINITE);
|
||||
}
|
||||
|
||||
void ReleaseGlobalLock()
|
||||
{
|
||||
ReleaseMutex(GlobalLock);
|
||||
}
|
||||
|
||||
unsigned int __stdcall EnterGenericThread (void* entry)
|
||||
{
|
||||
return ((TThreadEntrypoint)entry)(nullptr);
|
||||
}
|
||||
|
||||
//#define DUMP_COUNTERS
|
||||
|
||||
void OS_DumpMemoryCounters()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue