Statically allocate futex array
[folly.git] / folly / ProducerConsumerQueue.h
index fd9c94a0dc3fd49edda24695cb16323be4580a77..16de57d35486a8207fcb1def59c48d59a1360fd3 100644 (file)
@@ -167,6 +167,11 @@ struct ProducerConsumerQueue {
     return ret;
   }
 
+  // maximum number of items in the queue.
+  size_t capacity() const {
+    return size_ - 1;
+  }
+
  private:
   char pad0_[CacheLocality::kFalseSharingRange];
   const uint32_t size_;
@@ -178,4 +183,4 @@ struct ProducerConsumerQueue {
   char pad1_[CacheLocality::kFalseSharingRange - sizeof(writeIndex_)];
 };
 
-}
+} // namespace folly