Made use of atomic variables
In order to replace mutex-protected integer values (Performance improvement) Former-commit-id: d40ed2444111f00dab372f2371fe91cfd9cd2472
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <Nazara/Core/LockGuard.hpp>
|
||||
#include <Nazara/Core/Mutex.hpp>
|
||||
#include <Nazara/Core/Thread.hpp>
|
||||
#include <atomic>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
@@ -28,7 +29,7 @@ namespace
|
||||
NzMutex waiterConditionVariableMutex;
|
||||
NzMutex workerConditionVariableMutex;
|
||||
volatile bool running = true;
|
||||
unsigned int taskCount; ///TODO: Atomic
|
||||
std::atomic<unsigned int> taskCount;
|
||||
};
|
||||
|
||||
TaskSchedulerImpl* s_impl = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user