本文整理汇总了C++中CurOp::kill方法的典型用法代码示例。如果您正苦于以下问题:C++ CurOp::kill方法的具体用法?C++ CurOp::kill怎么用?C++ CurOp::kill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurOp
的用法示例。
在下文中一共展示了CurOp::kill方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: killOperation
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;
}
示例2: _killImpl_inclientlock
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;
}
示例3: checkForInterruptNoAssert
Status OperationContextImpl::checkForInterruptNoAssert() const {
if (getGlobalServiceContext()->getKillAllOperations()) {
return Status(ErrorCodes::InterruptedAtShutdown, "interrupted at shutdown");
}
CurOp* curOp = CurOp::get(this);
if (curOp->maxTimeHasExpired()) {
curOp->kill();
return Status(ErrorCodes::ExceededTimeLimit, "operation exceeded time limit");
}
MONGO_FAIL_POINT_BLOCK(checkForInterruptFail, scopedFailPoint) {
if (opShouldFail(this, scopedFailPoint.getData())) {
log() << "set pending kill on "
<< (curOp->parent() ? "nested" : "top-level")
<< " op " << curOp->opNum() << ", for checkForInterruptFail";
curOp->kill();
}
}
if (curOp->killPending()) {
return Status(ErrorCodes::Interrupted, "operation was interrupted");
}
return Status::OK();
}
示例4: kill
void KillCurrentOp::kill(AtomicUInt i) {
bool found = false;
{
scoped_lock l( Client::clientsMutex );
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 ) {
k->kill();
for( CurOp *l = ( *j )->curop(); l != k; l = l->parent() ) {
l->kill();
}
found = true;
}
}
}
}
if ( found ) {
interruptJs( &i );
}
}
示例5: _killOperationsAssociatedWithClientAndOpId_inlock
bool GlobalEnvironmentMongoD::_killOperationsAssociatedWithClientAndOpId_inlock(
Client* client, unsigned int opId) {
for( CurOp *k = client->curop(); k; k = k->parent() ) {
if ( k->opNum() != opId )
continue;
k->kill();
for( CurOp *l = client->curop(); l; l = l->parent() ) {
l->kill();
}
for (size_t i = 0; i < _killOpListeners.size(); i++) {
try {
_killOpListeners[i]->interrupt(opId);
}
catch (...) {
std::terminate();
}
}
return true;
}
return false;
}
示例6: killOperation
bool GlobalEnvironmentMongoD::killOperation(unsigned int opId) {
boost::mutex::scoped_lock clientLock(Client::clientsMutex);
bool found = false;
// XXX clean up
{
for(ClientSet::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) {
for (size_t i = 0; i < _killOpListeners.size(); i++) {
try {
_killOpListeners[i]->interrupt(opId);
}
catch (...) {
std::terminate();
}
}
}
return found;
}