fix compiler warnings from gcc-4.9 + -Wunused-variable
[folly.git] / folly / experimental / EventCount.h
index a0c289dadcfec8785b97a44307c8c0a5a1cd04f5..43c27b7c50a078e3065e82a38308aae0946cd20e 100644 (file)
 #include <syscall.h>
 #include <linux/futex.h>
 #include <sys/time.h>
-#include <cassert>
 #include <climits>
 #include <atomic>
 #include <thread>
+#include <glog/logging.h>
 
 #include <folly/Bits.h>
 #include <folly/Likely.h>
@@ -172,7 +172,7 @@ inline void EventCount::cancelWait() noexcept {
   // #waiters gets to 0, the less likely it is that we'll do spurious wakeups
   // (and thus system calls).
   uint64_t prev = val_.fetch_add(kSubWaiter, std::memory_order_seq_cst);
-  assert((prev & kWaiterMask) != 0);
+  DCHECK_NE((prev & kWaiterMask), 0);
 }
 
 inline void EventCount::wait(Key key) noexcept {
@@ -184,7 +184,7 @@ inline void EventCount::wait(Key key) noexcept {
   // #waiters gets to 0, the less likely it is that we'll do spurious wakeups
   // (and thus system calls)
   uint64_t prev = val_.fetch_add(kSubWaiter, std::memory_order_seq_cst);
-  assert((prev & kWaiterMask) != 0);
+  DCHECK_NE((prev & kWaiterMask), 0);
 }
 
 template <class Condition>