bool GlobalEnvironmentMongoD::killOperation(AtomicUInt opId) { scoped_lock clientLock(Client::clientsMutex); bool found = false; // XXX clean up { for( set< Client* >::const_iterator j = Client::clients.begin(); !found && j != Client::clients.end(); ++j ) { for( CurOp *k = ( *j )->curop(); !found && k; k = k->parent() ) { if ( k->opNum() != opId ) continue; k->kill(); for( CurOp *l = ( *j )->curop(); l; l = l->parent() ) { l->kill(); } found = true; } } } if ( found ) { interruptJs( &opId ); } return found; }
bool KillCurrentOp::_killImpl_inclientlock(AtomicUInt i, bool* pNotifyFlag /* = NULL */) { bool found = false; { for( set< Client* >::const_iterator j = Client::clients.begin(); !found && j != Client::clients.end(); ++j ) { for( CurOp *k = ( *j )->curop(); !found && k; k = k->parent() ) { if ( k->opNum() != i ) continue; k->kill(pNotifyFlag); for( CurOp *l = ( *j )->curop(); l; l = l->parent() ) { l->kill(); } found = true; } } } if ( found ) { interruptJs( &i ); } return found; }
void GlobalEnvironmentMongoD::setKillAllOperations() { _globalKill = true; interruptJs(0); }
void KillCurrentOp::killAll() { _globalKill = true; interruptJs( 0 ); }