mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
QueryPlanSet::Runner::mayYield cleaning
This commit is contained in:
parent
317c3a4e3b
commit
54dbf3aa1c
@ -626,18 +626,21 @@ doneCheckOrder:
|
||||
}
|
||||
|
||||
void QueryPlanSet::Runner::mayYield() {
|
||||
if ( _plans._mayYield ) {
|
||||
if ( _plans._yieldSometimesTracker.ping() ) {
|
||||
int micros = ClientCursor::yieldSuggest();
|
||||
if ( micros > 0 ) {
|
||||
if ( !prepareToYield() ) {
|
||||
return;
|
||||
}
|
||||
ClientCursor::staticYield( micros , _plans._ns , 0 );
|
||||
recoverFromYield();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ! _plans._mayYield )
|
||||
return;
|
||||
|
||||
if ( ! _plans._yieldSometimesTracker.ping() )
|
||||
return;
|
||||
|
||||
int micros = ClientCursor::yieldSuggest();
|
||||
if ( micros <= 0 )
|
||||
return;
|
||||
|
||||
if ( !prepareToYield() )
|
||||
return;
|
||||
|
||||
ClientCursor::staticYield( micros , _plans._ns , 0 );
|
||||
recoverFromYield();
|
||||
}
|
||||
|
||||
shared_ptr<QueryOp> QueryPlanSet::Runner::init() {
|
||||
|
Loading…
Reference in New Issue
Block a user