Made cycle count atomic to avoid using a mutex

This commit is contained in:
Jordan Cristiano
2015-03-31 04:09:33 -04:00
parent 6b6b5ed37f
commit 4051da75e4
3 changed files with 21 additions and 21 deletions

View File

@ -181,6 +181,15 @@ public:
flag.Set(s);
}
template<typename T>
void Do(std::atomic<T>& atomic)
{
T temp = atomic.load();
Do(temp);
if (mode == MODE_READ)
atomic.store(temp);
}
template <typename T>
void Do(T& x)
{