]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: remove the unnecessary checking to wakup event_wait
authorZhi Zhang <willzzhang@tencent.com>
Mon, 27 Jun 2016 04:59:08 +0000 (12:59 +0800)
committerZhi Zhang <willzzhang@tencent.com>
Mon, 27 Jun 2016 04:59:08 +0000 (12:59 +0800)
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
src/msg/async/Event.cc

index 41157e4c3ad1a9c9bd4880b9f5b0c92767001db1..eb20406774e7d1d77a3630f4e5cc5272d3292eb3 100644 (file)
@@ -262,15 +262,15 @@ void EventCenter::delete_time_event(uint64_t id)
 
 void EventCenter::wakeup()
 {
-  if (already_wakeup.compare_and_swap(0, 1)) {
     ldout(cct, 1) << __func__ << dendl;
+    already_wakeup.compare_and_swap(0, 1);
+
     char buf[1];
     buf[0] = 'c';
     // wake up "event_wait"
     int n = write(notify_send_fd, buf, 1);
     // FIXME ?
     assert(n == 1);
-  }
 }
 
 int EventCenter::process_time_events()