当前位置: 首页>>代码示例>>C++>>正文


C++ Probe::enableChildren方法代码示例

本文整理汇总了C++中Probe::enableChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ Probe::enableChildren方法的具体用法?C++ Probe::enableChildren怎么用?C++ Probe::enableChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Probe的用法示例。


在下文中一共展示了Probe::enableChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:SteveXiSong,项目名称:STAT,代码行数:26,代码来源:backend.cpp

示例2: relayPacket

DysectAPI::DysectErrorCode Backend::relayPacket(PacketPtr* packet, int tag, Stream* stream) {
  
  if(tag == DysectGlobalReadyTag){
    // Stream to respond when all streams have been bound
    if(controlStream != 0) {
      return Err::warn(Error, "Control stream already set");
    }

    controlStream = stream; 
    
    if((state == ready) && (!streamBindAckSent)) {
      ackBindings();
    }

    return OK;
  } 

  switch(state) {
    case bindingStreams:
    {
      if(Domain::isInitTag(tag)) {
        if(bindStream(tag, stream) != OK) {
          return Err::warn(StreamError, "Failed to bind stream!");
        }
      } else {
        assert(!"Save packet until all streams have been bound to domains - not yet supported"); 
      }
    }
    break;
    case ready:
    {
      if(tag == DysectGlobalStartTag) {
        enableProbeRoots();
      } else {
        if(Domain::isContinueTag(tag)) {
          
          Domain* dom = 0;
          if(!Domain::getDomainFromTag(dom, tag)) {
            Err::warn(false, "Domain for tag %x could not be found", tag);
          } else {
            Probe* probe = dom->owner;
            if(!probe) {
              Err::warn(false, "Probe for tag %x could not be found", tag);
            } else {
              ProcessSet::ptr lprocset = probe->getWaitingProcs();
              
              // OK to call - we are not in callback
              probe->enableChildren(lprocset);
              
              probe->releaseWaitingProcs();
            }
          }
        }
      }
    }
    break;
    default:
      return InvalidSystemState;
    break;
  }

  return OK;
}
开发者ID:LLNL,项目名称:DysectAPI,代码行数:63,代码来源:backend.cpp

示例3: 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);
      }
    }
    
//.........这里部分代码省略.........
开发者ID:SteveXiSong,项目名称:STAT,代码行数:101,代码来源:probe_be.cpp


注:本文中的Probe::enableChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。