Fix the build of detail/CacheLocality.h on Windows
[folly.git] / folly / detail / MPMCPipelineDetail.h
index 84312b33af5ed2acb960471e8571a865b38cfd22..c436c5f6816337abecb6da67888f7eee35ae161c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -76,8 +76,8 @@ class MPMCPipelineStageImpl {
   }
 
   uint64_t blockingRead(T& elem) noexcept {
-    uint64_t ticket = queue_.popTicket_++;
-    queue_.dequeueWithTicket(ticket, elem);
+    uint64_t ticket;
+    queue_.blockingReadWithTicket(ticket, elem);
     return ticket;
   }
 
@@ -87,12 +87,7 @@ class MPMCPipelineStageImpl {
 
   template <class... Args>
   bool readAndGetTicket(uint64_t& ticket, T& elem) noexcept {
-    if (queue_.tryObtainReadyPopTicket(ticket)) {
-      queue_.dequeueWithTicket(ticket, elem);
-      return true;
-    } else {
-      return false;
-    }
+    return queue_.readAndGetTicket(ticket, elem);
   }
 
   // See MPMCQueue<T>::writeCount; only works for the first stage