open source

This commit is contained in:
lvfulong
2020-11-11 16:17:13 +08:00
parent 4d989f3ecb
commit bc4ca748de
2441 changed files with 623057 additions and 2 deletions
+52
View File
@@ -0,0 +1,52 @@
/**
@file JCCondition.h
@brief
@author James
@version 1.0
@date 2016_5_12
*/
#ifndef __JCCondition_H__
#define __JCCondition_H__
#include <thread>
#include <condition_variable>
class JCCondition
{
std::recursive_mutex m_Mutex;
std::condition_variable_any m_Condition;
public:
void Wait()
{
m_Condition.wait( m_Mutex );
}
void NotifyOne()
{
m_Condition.notify_one();
}
void NotifyAll()
{
m_Condition.notify_all();
}
void Lock()
{
m_Mutex.lock();
}
void Unlock()
{
m_Mutex.unlock();
}
};
//------------------------------------------------------------------------------
#endif //__JCCondition_H__
//-----------------------------END FILE--------------------------------