]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: migrate atomic_t to <atomic> (async) 14657/head
authorJesse Williamson <jwilliamson@suse.de>
Tue, 23 May 2017 13:05:37 +0000 (06:05 -0700)
committerJesse Williamson <jwilliamson@suse.de>
Sun, 28 May 2017 15:48:15 +0000 (08:48 -0700)
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
src/msg/async/AsyncMessenger.h
src/msg/simple/Pipe.cc

index 01af51104959c53404a8416c7f982781bda1c81e..2868d65de90c3ebcc706d8a47a637619cb50b70f 100644 (file)
@@ -26,10 +26,11 @@ using namespace std;
 #include "include/unordered_set.h"
 
 #include "common/Mutex.h"
-#include "include/atomic.h"
 #include "common/Cond.h"
 #include "common/Thread.h"
 
+#include "include/Spinlock.h"
+
 #include "msg/SimplePolicyMessenger.h"
 #include "msg/DispatchQueue.h"
 #include "include/assert.h"
index cece32f0baadbfafddb4bdaeafb428fb39e4695a..fc415df8a093978609f8b885426636703f8d4de3 100644 (file)
@@ -858,7 +858,7 @@ int Pipe::accept()
       state = STATE_STANDBY;
     } else {
       state = STATE_CLOSED;
-      state_closed.set(1);
+      state_closed = true;
     }
     fault();
     if (queued || replaced)
@@ -879,7 +879,7 @@ int Pipe::accept()
   }
 
   state = STATE_CLOSED;
-  state_closed.set(1);
+  state_closed = true;
   fault();
   return -1;
 }
@@ -1583,7 +1583,7 @@ void Pipe::stop()
   ldout(msgr->cct,10) << "stop" << dendl;
   assert(pipe_lock.is_locked());
   state = STATE_CLOSED;
-  state_closed.set(1);
+  state_closed = true;
   cond.Signal();
   shutdown_socket();
 }
@@ -1793,7 +1793,7 @@ void Pipe::reader()
       pipe_lock.Lock();
       if (state == STATE_CLOSING) {
        state = STATE_CLOSED;
-       state_closed.set(1);
+       state_closed = true;
       } else {
        state = STATE_CLOSING;
       }
@@ -1841,7 +1841,7 @@ void Pipe::writer()
       ldout(msgr->cct,20) << "writer writing CLOSE tag" << dendl;
       char tag = CEPH_MSGR_TAG_CLOSE;
       state = STATE_CLOSED;
-      state_closed.set(1);
+      state_closed = true;
       pipe_lock.Unlock();
       if (sd >= 0) {
        // we can ignore return value, actually; we don't care if this succeeds.