1. Matt Oswald
  2. xUnit++

Commits

Matt Oswald  committed 6b3ccb5

fixed the concurrency < max issue

  • Participants
  • Parent commits a226bdd
  • Branches default

Comments (0)

Files changed (1)

File xUnit++/xUnitTestRunner.cpp

View file
  • Ignore whitespace
 
         void operator--()
         {
-            std::lock_guard<std::mutex> guard(mtx);
             --activeThreads;
+            condition.notify_one();
         }
 
     private:
         size_t maxThreads;
-        size_t activeThreads;
+        std::atomic<size_t> activeThreads;
         std::mutex mtx;
         std::condition_variable condition;
     } threadCounter(maxConcurrent);