mirror of
https://github.com/wu736139669/SmallGame_Cocos2dx.git
synced 2026-08-05 06:23:09 +00:00
28 lines
548 B
C++
28 lines
548 B
C++
/********************************************************************
|
|
created: 2014/04/01
|
|
filename: CriSection.h
|
|
author: 王少培
|
|
purpose:
|
|
*********************************************************************/
|
|
#include "CriSection.h"
|
|
|
|
CriSectionLock::CriSectionLock()
|
|
{
|
|
pthread_mutex_init(&mMutex,NULL);
|
|
}
|
|
|
|
CriSectionLock::~CriSectionLock()
|
|
{
|
|
pthread_mutex_destroy(&mMutex);
|
|
}
|
|
|
|
void CriSectionLock::enter()
|
|
{
|
|
pthread_mutex_lock(&mMutex);
|
|
}
|
|
|
|
void CriSectionLock::leave()
|
|
{
|
|
pthread_mutex_unlock(&mMutex);
|
|
}
|