mutex.cpp
来自「This source can emulate function generat」· C++ 代码 · 共 24 行
CPP
24 行
#include "Mutex.h"
Mutex::Mutex()
{
m_hMutex = CreateMutex(NULL, 0, NULL);
}
Mutex::~Mutex()
{
CloseHandle(m_hMutex);
m_hMutex = NULL;
}
void Mutex::Get()const
{
WaitForSingleObject( m_hMutex, INFINITE );
}
void Mutex::Release()const
{
ReleaseMutex(m_hMutex);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?