Commit 45873644 by Nicolas Capens Committed by Nicolas Capens

Prettify atomic initialization

Change-Id: I1230607ebbf0e7dadf8603d2fde5e7a95441c713 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35628 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 05823feb
...@@ -99,7 +99,6 @@ void Scheduler::unbind() ...@@ -99,7 +99,6 @@ void Scheduler::unbind()
} }
Scheduler::Scheduler() Scheduler::Scheduler()
: nextEnqueueIndex(0)
{ {
for (size_t i = 0; i < spinningWorkers.size(); i++) for (size_t i = 0; i < spinningWorkers.size(); i++)
{ {
......
...@@ -294,7 +294,7 @@ private: ...@@ -294,7 +294,7 @@ private:
// TODO: Make this lot thread-safe so setWorkerThreadCount() can be called // TODO: Make this lot thread-safe so setWorkerThreadCount() can be called
// during execution of tasks. // during execution of tasks.
std::atomic<unsigned int> nextEnqueueIndex; std::atomic<unsigned int> nextEnqueueIndex = { 0 };
unsigned int numWorkerThreads = 0; unsigned int numWorkerThreads = 0;
std::array<Worker*, MaxWorkerThreads> workerThreads; std::array<Worker*, MaxWorkerThreads> workerThreads;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment