lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 73a49ab 1/2: Make unit-test global state atom


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 73a49ab 1/2: Make unit-test global state atomic (VZ)
Date: Thu, 22 Jun 2017 07:14:02 -0400 (EDT)

branch: master
commit 73a49ab171f90dd95426c6e837ebca95cf94ac7f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Make unit-test global state atomic (VZ)
    
    See:
      http://lists.nongnu.org/archive/html/lmi/2017-06/msg00007.html
---
 test_main.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test_main.cpp b/test_main.cpp
index dca5894..73a3963 100644
--- a/test_main.cpp
+++ b/test_main.cpp
@@ -63,6 +63,7 @@
 #include "miscellany.hpp"               // stifle_warning_for_unused_value()
 #include "test_tools.hpp"
 
+#include <atomic>
 #include <iostream>
 #include <ostream>
 #include <regex>
@@ -75,8 +76,8 @@ namespace lmi_test
 {
   namespace test
   {
-    int test_tools_errors = 0;  // Count of errors detected.
-    int test_tools_successes = 0;  // Count of successful tests.
+    std::atomic<int> test_tools_errors    {0}; // Count of errors detected.
+    std::atomic<int> test_tools_successes {0}; // Count of successful tests.
 
     class test_tools_exception : public std::runtime_error
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]