0
0
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:
Eliot Horowitz 2011-06-24 16:23:13 -04:00
parent 317c3a4e3b
commit 54dbf3aa1c

View File

@ -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() {