Repository: mesos
Updated Branches:
  refs/heads/master 2e40c67ec -> f62530487


Fixed usage of ATOMIC_FLAG_INIT.

Review: https://reviews.apache.org/r/35841


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f6253048
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f6253048
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f6253048

Branch: refs/heads/master
Commit: f62530487198ce170e664e47902ddd5ab2b90d6f
Parents: 2e40c67
Author: Paul Brett <[email protected]>
Authored: Thu Jun 25 13:19:09 2015 -0700
Committer: Vinod Kone <[email protected]>
Committed: Thu Jun 25 13:19:11 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/future.hpp         | 5 ++---
 3rdparty/libprocess/include/process/http.hpp           | 5 ++---
 3rdparty/libprocess/include/process/metrics/metric.hpp | 3 +--
 3rdparty/libprocess/include/process/metrics/timer.hpp  | 4 ++--
 3rdparty/libprocess/include/process/mutex.hpp          | 4 ++--
 3rdparty/libprocess/include/process/queue.hpp          | 4 ++--
 3rdparty/libprocess/src/libevent_ssl_socket.hpp        | 2 +-
 7 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f6253048/3rdparty/libprocess/include/process/future.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/future.hpp 
b/3rdparty/libprocess/include/process/future.hpp
index b20eb06..a9e765d 100644
--- a/3rdparty/libprocess/include/process/future.hpp
+++ b/3rdparty/libprocess/include/process/future.hpp
@@ -388,7 +388,7 @@ private:
 
     void clearAllCallbacks();
 
-    std::atomic_flag lock;
+    std::atomic_flag lock = ATOMIC_FLAG_INIT;
     State state;
     bool discard;
     bool associated;
@@ -810,8 +810,7 @@ Future<T> Future<T>::failed(const std::string& message)
 
 template <typename T>
 Future<T>::Data::Data()
-  : lock(ATOMIC_FLAG_INIT),
-    state(PENDING),
+  : state(PENDING),
     discard(false),
     associated(false),
     result(None()) {}

http://git-wip-us.apache.org/repos/asf/mesos/blob/f6253048/3rdparty/libprocess/include/process/http.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/http.hpp 
b/3rdparty/libprocess/include/process/http.hpp
index e47cc7a..16f0a01 100644
--- a/3rdparty/libprocess/include/process/http.hpp
+++ b/3rdparty/libprocess/include/process/http.hpp
@@ -226,13 +226,12 @@ private:
   struct Data
   {
     Data()
-      : lock(ATOMIC_FLAG_INIT),
-        readEnd(Reader::OPEN),
+      : readEnd(Reader::OPEN),
         writeEnd(Writer::OPEN) {}
 
     // Rather than use a process to serialize access to the pipe's
     // internal data we use a 'std::atomic_flag'.
-    std::atomic_flag lock;
+    std::atomic_flag lock = ATOMIC_FLAG_INIT;
 
     Reader::State readEnd;
     Writer::State writeEnd;

http://git-wip-us.apache.org/repos/asf/mesos/blob/f6253048/3rdparty/libprocess/include/process/metrics/metric.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/metrics/metric.hpp 
b/3rdparty/libprocess/include/process/metrics/metric.hpp
index 44a7d5a..616f060 100644
--- a/3rdparty/libprocess/include/process/metrics/metric.hpp
+++ b/3rdparty/libprocess/include/process/metrics/metric.hpp
@@ -62,7 +62,6 @@ private:
   struct Data {
     Data(const std::string& _name, const Option<Duration>& window)
       : name(_name),
-        lock(ATOMIC_FLAG_INIT),
         history(None())
     {
       if (window.isSome()) {
@@ -73,7 +72,7 @@ private:
 
     const std::string name;
 
-    std::atomic_flag lock;
+    std::atomic_flag lock = ATOMIC_FLAG_INIT;
 
     Option<Owned<TimeSeries<double>>> history;
   };

http://git-wip-us.apache.org/repos/asf/mesos/blob/f6253048/3rdparty/libprocess/include/process/metrics/timer.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/metrics/timer.hpp 
b/3rdparty/libprocess/include/process/metrics/timer.hpp
index fd7b2db..813115a 100644
--- a/3rdparty/libprocess/include/process/metrics/timer.hpp
+++ b/3rdparty/libprocess/include/process/metrics/timer.hpp
@@ -89,8 +89,8 @@ public:
 
 private:
   struct Data {
-    Data() : lock(ATOMIC_FLAG_INIT) {}
-    std::atomic_flag lock;
+    Data() = default;
+    std::atomic_flag lock = ATOMIC_FLAG_INIT;
     Time start;
     Option<double> lastValue;
   };

http://git-wip-us.apache.org/repos/asf/mesos/blob/f6253048/3rdparty/libprocess/include/process/mutex.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/mutex.hpp 
b/3rdparty/libprocess/include/process/mutex.hpp
index 8fff089..37ea49a 100644
--- a/3rdparty/libprocess/include/process/mutex.hpp
+++ b/3rdparty/libprocess/include/process/mutex.hpp
@@ -60,7 +60,7 @@ public:
 private:
   struct Data
   {
-    Data() : lock(ATOMIC_FLAG_INIT), locked(false) {}
+    Data() : locked(false) {}
 
     ~Data()
     {
@@ -69,7 +69,7 @@ private:
 
     // Rather than use a process to serialize access to the mutex's
     // internal data we use a 'std::atomic_flag'.
-    std::atomic_flag lock;
+    std::atomic_flag lock = ATOMIC_FLAG_INIT;
 
     // Describes the state of this mutex.
     bool locked;

http://git-wip-us.apache.org/repos/asf/mesos/blob/f6253048/3rdparty/libprocess/include/process/queue.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/queue.hpp 
b/3rdparty/libprocess/include/process/queue.hpp
index 1496b38..5be29db 100644
--- a/3rdparty/libprocess/include/process/queue.hpp
+++ b/3rdparty/libprocess/include/process/queue.hpp
@@ -60,7 +60,7 @@ public:
 private:
   struct Data
   {
-    Data() : lock(ATOMIC_FLAG_INIT) {}
+    Data() = default;
 
     ~Data()
     {
@@ -69,7 +69,7 @@ private:
 
     // Rather than use a process to serialize access to the queue's
     // internal data we use a 'std::atomic_flag'.
-    std::atomic_flag lock;
+    std::atomic_flag lock = ATOMIC_FLAG_INIT;
 
     // Represents "waiters" for elements from the queue.
     std::deque<Owned<Promise<T>>> promises;

http://git-wip-us.apache.org/repos/asf/mesos/blob/f6253048/3rdparty/libprocess/src/libevent_ssl_socket.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent_ssl_socket.hpp 
b/3rdparty/libprocess/src/libevent_ssl_socket.hpp
index d65638b..e94e6d5 100644
--- a/3rdparty/libprocess/src/libevent_ssl_socket.hpp
+++ b/3rdparty/libprocess/src/libevent_ssl_socket.hpp
@@ -118,7 +118,7 @@ private:
   evconnlistener* listener;
 
   // Protects the following instance variables.
-  std::atomic_flag lock;
+  std::atomic_flag lock = ATOMIC_LOCK_INIT;
   Owned<RecvRequest> recv_request;
   Owned<SendRequest> send_request;
   Owned<ConnectRequest> connect_request;

Reply via email to