Spawn::~Spawn() { for (const auto& it : spawnedMap) { Monster* monster = it.second; monster->setSpawn(nullptr); monster->releaseThing2(); } stopEvent(); }
Spawn::~Spawn() { for (SpawnedMap::iterator it = spawnedMap.begin(); it != spawnedMap.end(); ++it) { Monster* monster = it->second; monster->setSpawn(nullptr); monster->releaseThing2(); } stopEvent(); }
status_t ESDSinkNode::TimeSourceOp(const time_source_op_info &op, void *_reserved) { CALLED(); switch(op.op) { case B_TIMESOURCE_START: PRINT(("TimeSourceOp op B_TIMESOURCE_START\n")); if (RunState() != BMediaEventLooper::B_STARTED) { fTimeSourceStarted = true; media_timed_event startEvent(0, BTimedEventQueue::B_START); EventQueue()->AddEvent(startEvent); } break; case B_TIMESOURCE_STOP: PRINT(("TimeSourceOp op B_TIMESOURCE_STOP\n")); if (RunState() == BMediaEventLooper::B_STARTED) { media_timed_event stopEvent(0, BTimedEventQueue::B_STOP); EventQueue()->AddEvent(stopEvent); fTimeSourceStarted = false; PublishTime(0, 0, 0); } break; case B_TIMESOURCE_STOP_IMMEDIATELY: PRINT(("TimeSourceOp op B_TIMESOURCE_STOP_IMMEDIATELY\n")); if (RunState() == BMediaEventLooper::B_STARTED) { media_timed_event stopEvent(0, BTimedEventQueue::B_STOP); EventQueue()->AddEvent(stopEvent); fTimeSourceStarted = false; PublishTime(0, 0, 0); } break; case B_TIMESOURCE_SEEK: PRINT(("TimeSourceOp op B_TIMESOURCE_SEEK\n")); BroadcastTimeWarp(op.real_time, op.performance_time); break; default: break; } return B_OK; }
DepthFirstStateAction::ResultE DepthFirstStateAction::apply(NodePtr pRoot) { ResultE result = NewActionTypes::Continue; startEvent(); result = startActors(); if(result & NewActionTypes::Quit) return result; _itInitialState = getState (); _itActiveState = cloneState(); // gained refs: active, root incRefCount(_itActiveState, 2); _nodeStack.push_back(NodeStackEntry(pRoot, _itActiveState, 1)); if((_extendLeaveActors.empty() == true) && (_basicLeaveActors .empty() == true) ) { result = traverseEnter(); } else { result = traverseEnterLeave(); } setState(_itInitialState); // lost refs: active, current node decRefCount(_itActiveState, 2); _itActiveState = _itInitialState; _stateClonedFlag = true; _nodeStack .clear(); #ifndef OSG_NEWACTION_STATESLOTINTERFACE _stateStore .clear(); #endif _stateRefCountStore.clear(); if(result & NewActionTypes::Quit) return result; result = stopActors(); stopEvent(); return result; }
// called from the scripting engine each time a statement node is hit. bool Debugger::hit(int line, bool breakPoint) { l = line; if (!eng) return true; if (!breakPoint && (mode() == Continue || mode() == Disabled)) return true; bool ret = stopEvent(); eng->init(); // in case somebody used a different interpreter meanwhile return ret; }
int main(int argc, char *argv[]) { ACE_Event stopEvent( 1, 0, USYNC_PROCESS, STOP_SERVER ); stopEvent.reset(); CTestTask g_TestTask; if (g_pHostFaultManager == NULL) { g_pHostFaultManager = new CHostFaultManager; } char filePath[] = "D:\\99se\\1.xml"; // CFaultInjectManager aa; // aa.DealWithSimData(filePath); //xercesc::XMLPlatformUtils::Terminate(); // HostCpuSimPar hostCpuSimPar; // hostCpuSimPar.tvBeginTime = time(NULL); // hostCpuSimPar.tvEndTime = time(NULL) + 1*60; // hostCpuSimPar.bIsCPUSim = true; // hostCpuSimPar.iCPUUsage = 75; // g_pHostFaultManager->SetHostCpuSimParm(hostCpuSimPar); // // HostMemSimPar hostMemSimPar; // hostMemSimPar.tvBeginTime = time(NULL) + 30; // hostMemSimPar.tvEndTime = time(NULL) + 2*60; // hostMemSimPar.bIsMemSim = true; // hostMemSimPar.iMemUsage = 85; // g_pHostFaultManager->SetHostMemSimParm(hostMemSimPar); // // HostIOSimPar hostIOSimPar; // hostIOSimPar.tvBeginTime = time(NULL) + 1*60; // hostIOSimPar.tvEndTime = time(NULL) + 3*60; // hostIOSimPar.bIsIOSim = true; // hostIOSimPar.iIORSim = 1024; // hostIOSimPar.iIOWSim = 1024; // g_pHostFaultManager->SetHostIOSimParm(hostIOSimPar); // while (1) // { // Sleep(1000); // } //! 等待StartServer通知进程终止运行 stopEvent.wait(); stopEvent.signal(); //!< 需要将信号保持有效状态 return 0; }
Spawn::~Spawn() { stopEvent(); Monster* monster = NULL; for(SpawnedMap::iterator it = spawnedMap.begin(); it != spawnedMap.end(); ++it) { if(!(monster = it->second)) continue; monster->setSpawn(NULL); if(!monster->isRemoved()) g_game.FreeThing(monster); } spawnedMap.clear(); spawnMap.clear(); }
void Iax2Session::Stop() { CStdString logMsg; logMsg.Format("[%s] %s Session stop, numIax2Pkts:%d dupl:%d seqDelta:%d " "lastUpdated:%u", m_trackingId, m_capturePort, m_numIax2Packets, m_hasDuplicateIax2, m_highestIax2SeqNumDelta, m_lastUpdated); LOG4CXX_INFO(m_log, logMsg); if(m_started && !m_stopped) { CaptureEventRef stopEvent(new CaptureEvent); stopEvent->m_type = CaptureEvent::EtStop; stopEvent->m_timestamp = m_lastUpdated; g_captureEventCallBack(stopEvent, m_capturePort); m_stopped = true; } }