Files
Ben Marsh cceb95f6e5 Merging non-unity fix.
#rb none
#jira
#rnx

[CL 6455342 by Ben Marsh in 4.22 branch]
2019-05-14 18:19:59 -04:00

43 lines
700 B
C++

// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
#pragma once
#include "Windows/MinimalWindowsAPI.h"
#include "LC_Platform.h"
class InterprocessMutex
{
public:
explicit InterprocessMutex(const wchar_t* name);
~InterprocessMutex(void);
void Lock(void);
void Unlock(void);
class ScopedLock
{
public:
explicit ScopedLock(InterprocessMutex* mutex)
: m_mutex(mutex)
{
mutex->Lock();
}
~ScopedLock(void)
{
m_mutex->Unlock();
}
private:
LC_DISABLE_COPY(ScopedLock);
LC_DISABLE_MOVE(ScopedLock);
LC_DISABLE_ASSIGNMENT(ScopedLock);
LC_DISABLE_MOVE_ASSIGNMENT(ScopedLock);
InterprocessMutex* m_mutex;
};
private:
Windows::HANDLE m_mutex;
};