/** Any pulses received on the Looper's IPC port are * passed to this virtual method. * * \warning Do not delete the Pulse parameter that you are given. It does * not belong to you either. * * \param pulse A pointer to the received Pulse. */ void Looper::PulseReceived( Pulse* pulse ) { switch ((*pulse)[0]) { case QUIT_REQUESTED: QuitRequested(); Terminate(); break; } }
static void CantDoIt( void ) { if( PendingProgramInterrupt ) { if( MessageBox( 0, TRP_WIN_wanna_kill, TRP_The_WATCOM_Debugger, MB_SYSTEMMODAL + MB_YESNO + MB_ICONQUESTION ) == IDYES ) { Terminate(); } } else if( MessageBox( 0, TRP_WIN_wanna_interrupt, TRP_The_WATCOM_Debugger, MB_SYSTEMMODAL + MB_YESNO + MB_ICONQUESTION ) == IDYES ) { InterruptProgram(); } }
CRunQueue::~CRunQueue() { if (mh_Thread) { Terminate(); SafeCloseHandle(mh_Thread); } SafeDelete(mpcs_QueueLock); }
int main(int argc, char **argv) { Initialize(argc, argv); ReadLog(); Terminate(); return(1); }
CThread::~CThread() { try { Terminate(); EndThread(); } catch (...) { _Done(); // throw; } _Done(); }
void unconsciousness::Handle() { if(!--Counter) Terminate(true); else { Actor->EditExperience(ARM_STRENGTH, -50, 1 << 2); Actor->EditExperience(LEG_STRENGTH, -50, 1 << 2); } }
/** * * Method Name: ~CRTCPConnection() - Destructor * * * Inputs: None * * Outputs: None * * Returns: None * * Description: Shall deallocated and/or release all resources which was * acquired over the course of runtime. In particular, the * following shall occur: * ==> Shall release the reference to the RTCP Render object * ==> Shall release the reference to the RTCP Source object * * Usage Notes: * * */ CRTCPConnection::~CRTCPConnection(void) { // Terminate Connection and release any remaining references to interfaces // and objects Terminate(); m_piRTCPNotify->Release(); m_piSDESReport->Release(); }
static void WindowChar(char Ch) { if (_CheckBreak && (Ch == 3)) Terminate(); if (KeyCount < sizeof(KeyBuffer)) { KeyBuffer[KeyCount] = Ch; ++KeyCount; } }
int Child2(char *arg) { if (!(strcmp(arg,"Child2"))){ USLOSS_Console("Child2(): starting\n"); Terminate(9); } else { if (!(strcmp(arg,"Child3"))){ USLOSS_Console("Child3(): starting\n"); Terminate(10); } else { USLOSS_Console("wrong argument passed ... test failed\n"); exit(1); } } return 0; } /* Child2 */
int Child2a(char *arg) { int pid; GetPID(&pid); USLOSS_Console("%s(): starting the code for Child2a: pid=%d\n", arg, pid); Terminate(11); return 0; } /* Child2a */
CzHttp::~CzHttp( void ) { // デストラクタ // Terminate(); if ( str_agent != NULL ) { free( str_agent ); str_agent = NULL; } }
//******************************************************* // WGEN driver //******************************************************* int main ( INT argc, char **argv, char **envp) { INT error_count, sorry_count; BOOL need_inliner; struct stat sbuf; int st; Set_Error_Tables ( Phases, host_errlist ); Process_Command_Line(argc, argv); st = stat(Spin_File_Name, &sbuf); if (st == -1 && (errno == ENOENT || errno == ENOTDIR)) printf ("wgen: file %s does not exist\n", Spin_File_Name); else if ((program = gs_read_file (Spin_File_Name)) != (gs_t) NULL) { // gs_dump(program); Process_Cc1_Command_Line(gs_cc1_command_line_args(program)); WGEN_Init(argc, argv, envp); WGEN_File_Init(argc, argv); gs_t list = gs_operand(program, GS_PROGRAM_DECLARATIONS); // in bug 10185, first list node is NULL, so skip first node if (gs_code(list) != EMPTY) list = gs_operand(list, 1); for (; gs_code(list) != EMPTY; list = gs_operand(list, 1)) { gs_t decl = gs_operand(list, 0); WGEN_Expand_Top_Level_Decl(decl); #ifdef KEY WGEN_Expand_Defers(); #endif } #ifdef KEY if (!lang_cplus) WGEN_Alias_Finish(); #endif WGEN_Weak_Finish(); WGEN_File_Finish (); WGEN_Finish (); } else printf ("wgen: libspin returned (gs_t) NULL.\n"); WGEN_Check_Errors (&error_count, &sorry_count, &need_inliner); if (error_count) Terminate (RC_INTERNAL_ERROR) ; if (need_inliner && ((!Enable_WFE_DFE) || (Opt_Level > 1))) exit ( RC_NEED_INLINER ); exit (RC_OKAY); }
void Throw() { for (Janitor* jan = JumpBase::jl->janitor; jan; jan = jan->NextJanitor) jan->CleanUp(); JumpItem* jx = JumpBase::jl->ji; // previous jumpbase; if ( !jx ) { Terminate(); } // jl was initial JumpItem JumpBase::jl = jx; // drop down a level; cannot be in front // of previous line Tracer::last = JumpBase::jl->trace; longjmp(JumpBase::jl->env, 1); }
virtual ~LocalizationDirectoryMonitorThread() { Terminate(); DWORD aWaitResult = WaitForSingleObject(myHandle, 5000); //wait 5 seconds if (aWaitResult != WAIT_OBJECT_0) TerminateThread(myHandle, 1); CloseHandle(myTerminateEvent); }
int main() { Initialize(); // --HowTo: Load the tmx map from the json file tmxparser::Map_t *map = new tmxparser::Map_t; tmxparser::parseTmxFromJSON_file("testLevel.json", map); // --HowTo: Create a renderer tmxparser::TmxRenderer *renderer = new tmxparser::TmxRenderer(map); // an offset to use for scrolling the map CIwFVec2 offset(0,0); IwGxSetColClear(0x2f, 0x3f, 0x3f, 0xff); // Loop forever, until the user or the OS performs some action to quit the app while (!s3eDeviceCheckQuitRequest()) { //Update the input systems s3eKeyboardUpdate(); s3ePointerUpdate(); // Clear the surface IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F); // --HowTo: render all layers, at original pixel size: //renderer->Render(offset); // --HowTo: render all layers at reduced/scaled tile size renderer->Render(offset, CIwFVec2(64.0f, 64.0f)); // --HowTo: render only one layer at original pixel size //renderer->RenderLayer(0, offset, CIwFVec2(0.0f, 0.0f)); // --HowTo: render only one layer at scaled pixel size //renderer->RenderLayer(0, offset, CIwFVec2(64.0f, 64.0f)); // advance offset offset.x += 3; if (offset.x>1900) offset.x =0; // Standard EGL-style flush of drawing to the surface IwGxFlush(); IwGxSwapBuffers(); s3eDeviceYield(0); } delete renderer; delete map; Terminate(); // Return return 0; }
STDMETHODIMP CTestCases::Terminate(VARIANT_BOOL* pbResult) { TRACE("CTestCases::Terminate\n"); //Delegate to the derived class... VARIANT_BOOL bResult = (VARIANT_BOOL)Terminate(); if(pbResult) *pbResult = bResult ? VARIANT_TRUE : VARIANT_FALSE; return S_OK; }
InterruptHandler::~InterruptHandler() { StartTrace(InterruptHandler.Dtor); if ( GetId() != 0 ) { THRKILL(GetId(), SIGTERM); } Terminate(); CheckState(Thread::eTerminated); if (fServer) { fServer->RemovePIDFile(); } }
long CHFServer::Uninitialize() { if (::InterlockedDecrement(&m_nCount) == 0 && m_hThread) { SetEvent(m_hEventStop); //m_Strategy.Stop(); m_spBatchPerfMon = NULL; Terminate(); return m_nStatus; } return DBA_ERR_NO_ERROR; }
int main(int argc, char* argv[]) { const char* rendererFlag = getCmdOption(argv, argv + argc, "--renderer"); auto game = Game(); if(game.Init(rendererFlag)) { game.Loop(); } game.Terminate(); return 0; }
CThread::~CThread() { // If the thread is still running. if (m_nThreadId != 0 && !m_bFinished) { Terminate(); WaitFor(); } if (m_nThreadId != 0) CloseHandle(m_hHandle); }
void CchaffIGC::Update(Time now) { float dtLeft = Seconds(m_timeExpire - now).count(); if (dtLeft <= 0.0f) Terminate(); else { float r = m_pChaffTypeData->radius * (1.0f - dtLeft / m_pChaffTypeData->lifespan); SetRadius(r > 1.0f ? r : 1.0f); TmodelIGC<IchaffIGC>::Update(now); } }
int start3(char *arg) { int pid; printf("start3(): started. Calling Spawn for Child1\n"); Spawn("Child1", Child1, NULL, USLOSS_MIN_STACK, 2, &pid); printf("start3(): after spawn of %d\n", pid); printf("start3(): Parent done. Calling Terminate.\n"); Terminate(8); return 0; } /* start3 */
bool RecorderSession::OnChannelAdd(mrcp_channel_t* pMrcpChannel, mrcp_sig_status_code_e status) { if(!UmcSession::OnChannelAdd(pMrcpChannel,status)) return false; if(status != MRCP_SIG_STATUS_CODE_SUCCESS) { /* error case, just terminate the demo */ return Terminate(); } return StartRecorder(pMrcpChannel); }
int main(int argc, char **argv) { int status = 0; ofp = stdout; /* Where the output will go */ Initialize(argc, argv); Compare(); if (globals.files_are_different) { PrintResults(); } Terminate(); return status; }
int Child2b(char *arg) { int pid, status; GetPID(&pid); USLOSS_Console("\n%s(): starting, pid = %d\n", arg, pid); Spawn("Child2c", Child2c, "Child2c", USLOSS_MIN_STACK, 1, &pid); USLOSS_Console("%s(): spawned process %d\n", arg, pid); Wait(&pid, &status); Terminate(50); return 0; } /* Child2b */
ThreadImpl::~ThreadImpl() { if(IsActive()) { if(m_hdl != 0) { Terminate(); Join(INFINITE); ::CloseHandle(m_hdl); } } }
void rest::Handle() { if((GoalHP && (GetActor()->GetHP() >= GoalHP || GetActor()->GetHP() == GetActor()->GetMaxHP() || !GetActor()->CanHeal())) || (MinToStop && game::GetTotalMinutes() >= MinToStop)) Terminate(true); else { GetActor()->EditExperience(DEXTERITY, -25, 1 << 1); GetActor()->EditExperience(AGILITY, -25, 1 << 1); } }
int Child2(char *arg) { int i; USLOSS_Console("\n%s(): starting\n", arg); for (i = 0; i < 5; i++) { SemV(sem1); USLOSS_Console("%s(): After V attempt #%d\n", arg, i); } USLOSS_Console("%s(): done\n", arg); Terminate(10); return 0; } /* Child2 */
//=================================== // Function Start //=================================== int main (void) { init (); ThreadInit(); LifeGame(); #ifndef __NOOUTPUT Out (); #endif Terminate (); return 0; }
int main() { Initialise(); while (!s3eDeviceCheckQuitRequest()) { Update(); Render(); } Terminate(); return 0; }