📄 cmonitor.cpp
字号:
/*******************************************************************
* Advanced 3D Game Programming using DirectX 9.0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* copyright (c) 2003 by Peter A Walsh and Adrian Perez
* See license.txt for modification and distribution information
******************************************************************/
// cMonitor.cpp: implementation of the cMonitor class.
//
//////////////////////////////////////////////////////////////////////
#include "cMonitor.h"
#include "cNetError.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cMonitor::cMonitor()
{
// This mutex will help the two threads share their toys.
d_mutex = CreateMutex( NULL, false, NULL );
if( d_mutex == NULL )
throw cNetError( "cMonitor() - Mutex creation failed." );
}
cMonitor::~cMonitor()
{
if( d_mutex != NULL )
{
CloseHandle( d_mutex );
d_mutex = NULL;
}
}
void cMonitor::MutexOn() const
{
WaitForSingleObject( d_mutex, INFINITE ); // To be safe...
}
void cMonitor::MutexOff() const
{
ReleaseMutex( d_mutex ); // To be safe...
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -