mutex.h
来自「这是DVD中伺服部分的核心代码」· C头文件 代码 · 共 69 行
H
69 行
/******************************************************************************
*******************************************************************************
** **
** Copyright (c) 2006 Videon Central, Inc. **
** All rights reserved. **
** **
** The computer program contained herein contains proprietary information **
** which is the property of Videon Central, Inc. The program may be used **
** and/or copied only with the written permission of Videon Central, Inc. **
** or in accordance with the terms and conditions stipulated in the **
** agreement/contract under which the programs have been supplied. **
** **
*******************************************************************************
******************************************************************************/
/**
* @file mutex.h
*
* $Revision: 1.5 $
*
* Implements a Mutual Exlusion (Mutex) object class
*
*/
#ifndef __MUTEX_H
#define __MUTEX_H
#if _MSC_VER
#include <windows.h>
#else
#include <pthread.h>
#endif
#include "error.h"
class Mutex
{
protected:
#if _MSC_VER
CRITICAL_SECTION criticalSection;
#else
pthread_mutex_t criticalSection;
#endif
public:
Mutex ( void );
VDVD_ERROR Lock ( void );
VDVD_ERROR Unlock ( void );
};
class AutoMutex
{
private:
Mutex* m_pMutex;
public:
AutoMutex ( Mutex* pMutex );
~AutoMutex ( void );
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?