void AsyncResultsMerger::signalCurrentEventIfReady_inlock() { if (ready_inlock() && _currentEvent.isValid()) { // To prevent ourselves from signalling the event twice, we set '_currentEvent' as // invalid after signalling it. _executor->signalEvent(_currentEvent); _currentEvent = executor::TaskExecutor::EventHandle(); } }
StatusWith<boost::optional<BSONObj>> AsyncClusterClientCursor::nextReady() { stdx::lock_guard<stdx::mutex> lk(_mutex); dassert(ready_inlock()); if (_lifecycleState != kAlive) { return Status(ErrorCodes::IllegalOperation, "async cluster client cursor killed"); } if (!_status.isOK()) { return _status; } const bool hasSort = !_params.sort.isEmpty(); return hasSort ? nextReadySorted() : nextReadyUnsorted(); }
StatusWith<boost::optional<BSONObj>> AsyncResultsMerger::nextReady() { stdx::lock_guard<stdx::mutex> lk(_mutex); dassert(ready_inlock()); if (_lifecycleState != kAlive) { return Status(ErrorCodes::IllegalOperation, "AsyncResultsMerger killed"); } if (!_status.isOK()) { return _status; } if (_eofNext) { _eofNext = false; return {boost::none}; } const bool hasSort = !_params.sort.isEmpty(); return hasSort ? nextReadySorted() : nextReadyUnsorted(); }
bool AsyncResultsMerger::ready() { stdx::lock_guard<stdx::mutex> lk(_mutex); return ready_inlock(); }
bool AsyncClusterClientCursor::ready() { stdx::lock_guard<stdx::mutex> lk(_mutex); return ready_inlock(); }