initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#include "Cevo/SyncCounter.h"
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
int SyncCounter::allocate()
|
||||
{
|
||||
QMutexLocker locker(&m_lock);
|
||||
return m_top++;
|
||||
}
|
||||
|
||||
bool SyncCounter::currentEqualTo(int value) const
|
||||
{
|
||||
QMutexLocker locker(&m_lock);
|
||||
return value == m_current;
|
||||
}
|
||||
|
||||
void SyncCounter::increment()
|
||||
{
|
||||
QMutexLocker locker(&m_lock);
|
||||
++m_current;
|
||||
}
|
||||
|
||||
void SyncCounter::assign(const SyncCounter &source)
|
||||
{
|
||||
m_current = source.m_current;
|
||||
m_top = source.m_top;
|
||||
}
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user