You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
469 B
24 lines
469 B
#include "PassportLock.hpp"
|
|
|
|
PassportLock::PassportLock(DWORD dwSpinCount)
|
|
{
|
|
if(0 ==InitializeCriticalSectionAndSpinCount(&mLock, dwSpinCount))
|
|
{
|
|
throw(GetLastError()); // it's safe to throw, no issue about partial construction
|
|
}
|
|
}
|
|
|
|
void PassportLock::acquire()
|
|
{
|
|
EnterCriticalSection(&mLock);
|
|
}
|
|
|
|
void PassportLock::release()
|
|
{
|
|
LeaveCriticalSection(&mLock);
|
|
}
|
|
|
|
PassportLock::~PassportLock()
|
|
{
|
|
DeleteCriticalSection(&mLock);
|
|
}
|