[niepce] fwk: use atomics for thread termination.



commit 019fce90c579c75ab8bbdf557f43c513fc2bfbc1
Author: Hubert Figuière <hub figuiere net>
Date:   Fri Feb 6 23:12:06 2015 -0500

    fwk: use atomics for thread termination.

 src/fwk/utils/thread.hpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/fwk/utils/thread.hpp b/src/fwk/utils/thread.hpp
index 7473820..c2c5b97 100644
--- a/src/fwk/utils/thread.hpp
+++ b/src/fwk/utils/thread.hpp
@@ -1,7 +1,7 @@
 /*
  * niepce - fwk/utils/thread.hpp
  *
- * Copyright (C) 2007-2013 Hubert Figuiere
+ * Copyright (C) 2007-2015 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 #ifndef __FWK_UTILS_THREAD_H__
 #define __FWK_UTILS_THREAD_H__
 
-
+#include <atomic>
 #include <string>
 #include <thread>
 
@@ -39,7 +39,7 @@ public:
 protected:
     void start();
     virtual void main() = 0;
-    volatile bool m_terminated;
+    std::atomic_bool m_terminated;
     std::thread * thread() const
         { return m_thrd; }
 private:


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