projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
folly::fibers::Baton API consistency with folly::Baton
[folly.git]
/
folly
/
ProducerConsumerQueue.h
diff --git
a/folly/ProducerConsumerQueue.h
b/folly/ProducerConsumerQueue.h
index fd9c94a0dc3fd49edda24695cb16323be4580a77..16de57d35486a8207fcb1def59c48d59a1360fd3 100644
(file)
--- a/
folly/ProducerConsumerQueue.h
+++ b/
folly/ProducerConsumerQueue.h
@@
-167,6
+167,11
@@
struct ProducerConsumerQueue {
return ret;
}
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_;
private:
char pad0_[CacheLocality::kFalseSharingRange];
const uint32_t size_;
@@
-178,4
+183,4
@@
struct ProducerConsumerQueue {
char pad1_[CacheLocality::kFalseSharingRange - sizeof(writeIndex_)];
};
char pad1_[CacheLocality::kFalseSharingRange - sizeof(writeIndex_)];
};
-}
+}
// namespace folly