本文整理汇总了C++中Probe::disable方法的典型用法代码示例。如果您正苦于以下问题:C++ Probe::disable方法的具体用法?C++ Probe::disable怎么用?C++ Probe::disable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Probe
的用法示例。
在下文中一共展示了Probe::disable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleTimerActions
DysectAPI::DysectErrorCode Backend::handleTimerActions() {
pthread_mutex_lock(&probesPendingActionMutex);
if (probesPendingAction.size() > 0) {
DYSECTVERBOSE(true, "Handle timer actions");
vector<Probe*>::iterator probeIter = probesPendingAction.begin();
for(;probeIter != probesPendingAction.end(); probeIter++) {
Probe* probe = *probeIter;
Domain* dom = probe->getDomain();
DYSECTVERBOSE(true, "Sending enqueued actions for timed probe: %x", dom->getId());
probe->sendEnqueuedActions();
if(probe->numWaitingProcs() > 0) {
ProcessSet::ptr lprocset = probe->getWaitingProcs();
probe->enableChildren(lprocset);
if(probe->getLifeSpan() == fireOnce)
probe->disable(lprocset);
lprocset->continueProcs();
probe->releaseWaitingProcs();
}
}
probesPendingAction.clear();
}
pthread_mutex_unlock(&probesPendingActionMutex);
return OK;
}
示例2: processRequests
bool Probe::processRequests() {
if(requestQueue.empty()) {
return true;
}
pthread_mutex_lock(&requestQueueMutex);
vector<ProbeRequest*> queue = requestQueue;
requestQueue.clear();
pthread_mutex_unlock(&requestQueueMutex);
ProcessSet::ptr continueSet = ProcessSet::newProcessSet();
// Sort queue
deque<ProbeRequest*> sortedQueue;
vector<ProbeRequest*>::iterator requestIter = queue.begin();
for(int i = 0; requestIter != queue.end(); requestIter++) {
ProbeRequest* request = *requestIter;
if(!request) {
DYSECTWARN(true, "Invalid request in request queue");
break;
}
if(request->type == DisableType) {
sortedQueue.push_back(request);
} else {
sortedQueue.push_front(request);
}
}
if (sortedQueue.size() == 0)
return true;
DYSECTVERBOSE(true, "Handling %d process requests", sortedQueue.size());
deque<ProbeRequest*>::iterator sortedRequestIter = sortedQueue.begin();
for(int i = 0; sortedRequestIter != sortedQueue.end(); sortedRequestIter++) {
ProbeRequest* request = *sortedRequestIter;
if(!request) {
DYSECTWARN(true, "Invalid request in request queue");
break;
}
DYSECTVERBOSE(true, "processRequests() %d", i++);
Probe* probe = request->probe;
if(!probe) {
DYSECTWARN(false, "Probe not found for disable request!");
break;
}
ProcessSet::ptr waitingProcs = request->scope;
if(waitingProcs && waitingProcs->size() > 0) {
DYSECTVERBOSE(true, "Adding %d request processes to %d continue set...", waitingProcs->size(), continueSet->size());
continueSet = continueSet->set_union(waitingProcs);
}
ProcessSet::ptr operationSet = ProcessSet::newProcessSet();
ProcessSet::ptr stopSet = ProcessSet::newProcessSet();
ProcessSet::ptr scope = request->scope;
if(scope && scope->size() > 0) {
DYSECTVERBOSE(true, "Adding processes from scope set (%d) to affected procs (%d)", scope->size(), operationSet->size());
operationSet = operationSet->set_union(scope);
}
//
// Filter out detached
//
operationSet = ProcessMgr::filterDetached(operationSet);
stopSet = ProcessMgr::filterDetached(stopSet);
DYSECTVERBOSE(true, "%d procs in op set, %d procs in stop set", operationSet->size(), stopSet->size());
//
// Stop processes
//
stopSet = operationSet->getAnyThreadRunningSubset();
if(stopSet && stopSet->size() > 0) {
DYSECTVERBOSE(true, "Stopping %d processes", stopSet->size());
stopSet->stopProcs();
}
//
// Carry out operations
//
if(operationSet && operationSet->size() > 0) {
if(request->type == DisableType) {
DYSECTVERBOSE(true, "Disabling %d processes", operationSet->size());
probe->disable(operationSet);
} else {
DYSECTVERBOSE(true, "Enabling %d processes", operationSet->size());
probe->enableChildren(operationSet);
}
}
//.........这里部分代码省略.........