Commit 1771e14f authored by Ha Truong's avatar Ha Truong Committed by Facebook GitHub Bot

Removed implicit conversion in Folly

Summary: Declared maxReadAtOnce_ in AtomicNotificationQueue.h as uint_32 to avoid implicit conversion in AtomicNotificationQueue-inl.h

Reviewed By: yfeldblum

Differential Revision: D33645415

fbshipit-source-id: 0eb57074951f1320df2dbb1d302cba69a727af56
parent 38b34a64
...@@ -321,7 +321,7 @@ bool AtomicNotificationQueue<Task>::drive(Consumer&& consumer) { ...@@ -321,7 +321,7 @@ bool AtomicNotificationQueue<Task>::drive(Consumer&& consumer) {
nextQueue = atomicQueue_.getTasks(); nextQueue = atomicQueue_.getTasks();
} }
const bool wasAnyProcessed = !queue_.empty() || !nextQueue.empty(); const bool wasAnyProcessed = !queue_.empty() || !nextQueue.empty();
for (int32_t numConsumed = 0; for (uint32_t numConsumed = 0;
maxReadAtOnce_ == 0 || numConsumed < maxReadAtOnce_;) { maxReadAtOnce_ == 0 || numConsumed < maxReadAtOnce_;) {
if (queue_.empty()) { if (queue_.empty()) {
queue_ = std::move(nextQueue); queue_ = std::move(nextQueue);
......
...@@ -240,7 +240,7 @@ class AtomicNotificationQueue { ...@@ -240,7 +240,7 @@ class AtomicNotificationQueue {
AtomicQueue atomicQueue_; AtomicQueue atomicQueue_;
Queue queue_; Queue queue_;
std::atomic<ssize_t> taskExecuteCount_{0}; std::atomic<ssize_t> taskExecuteCount_{0};
int32_t maxReadAtOnce_{10}; uint32_t maxReadAtOnce_{10};
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment