Commit f63a5c31 authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook GitHub Bot

Don't access evb_ in AtomicNotificationQueue::size()

Summary:
evb_ can be updated by start/stopConsuming, so it's not safe to access it in the assertion (given that size() is thread safe).

(Note: this ignores all push blocking failures!)

Differential Revision: D24559287

fbshipit-source-id: b5886ce13fa54fb59361c1de110ec8bb02a06a12
parent cb0fc3dc
......@@ -225,7 +225,6 @@ void AtomicNotificationQueue::setMaxReadAtOnce(uint32_t maxAtOnce) {
int32_t AtomicNotificationQueue::size() const {
auto queueSize = atomicQueue_.getPushCount() -
taskExecuteCount_.load(std::memory_order_relaxed);
DCHECK(!evb_ || !evb_->isInEventBaseThread() || queueSize >= 0);
return queueSize >= 0 ? queueSize : 0;
}
......
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