コード例 #1
0
ファイル: bmnet.cpp プロジェクト: Voskrese/mipsonqemu
void MyThread::monitorTimeout(){
	STOP_TIMER(monitorTimer);
	if(terminateFlag)
		terminateThread();
	else
	{
		monitorTimer->start(10);
	}
}
コード例 #2
0
ファイル: LtpInterface.c プロジェクト: Michael-Z/Spokn-iphone
int	  endLtp(LtpInterfaceType *ltpInterfaceP)
{
	
	//
	Boolean clearProfileB = false;
	applicationEnd();

	DeInitAudio( ltpInterfaceP->playbackP,false);
	DeInitAudio( ltpInterfaceP->recordP,false);
	ltpInterfaceP->playbackP = 0;
	ltpInterfaceP->recordP = 0;
	#ifdef _LTP_	
	
		if(ltpInterfaceP->ltpObjectP->sipOnB==false)
		{
			
		
			#ifdef _OWN_THREAD_
	
			ltpInterfaceP->pthreadstopB = true;
			while(ltpInterfaceP->pthreadstopB)
			{
				sleep(1);
			}
			//pthread_cancel(ltpInterfaceP->pthObj);
			//pthread_exit(ltpInterfaceP->pthObj);
			ltpInterfaceP->pthObj = 0;
		}	
		#endif
	#endif
	if(ltpInterfaceP->ltpObjectP->sipOnB)
	{
		sip_pj_DeInit(ltpInterfaceP->ltpObjectP);
		ltpInterfaceP->pjsipStartB = false;
	}
	if (ltpInterfaceP->ltpObjectP->ltpUserid[0]==0)
	{
		clearProfileB = true;
	}
	if(terminateThread()==0)
	{	
		free(ltpInterfaceP->ltpObjectP);
	}	
		ltpInterfaceP->ltpObjectP  = 0;
	
		/* destroys the mutex */
	ltpInterfaceP->pthreadstopB = true;
		pthread_mutex_destroy(&mutex);
	free(ltpInterfaceP);
	if(clearProfileB)
	{
		profileClear();
	}
	return 0;
}
コード例 #3
0
void ClassifierConfiguration::entryPoint(){

    //_begin = time(0);
    if(!fileExists(outputFilename)){
        buildClassifier();
    }else{
        logln("Output already exists: " + outputFilename);
    }
    //_end = time(0);

    ClassifierOutput *clOut = handleOutput();

    writeToCSV(clOut);


    return terminateThread();
}
コード例 #4
0
ファイル: example.c プロジェクト: stephenmarkham/ARDrone
int main ()
{
   // ----- Required Code -------------------------
   //Create new control thread
   pthread_t ControlThread;
   if(pthread_create(&ControlThread, NULL, DroneControl, NULL)) {
      fprintf(stderr, "Error creating thread\n");
      return 1;
   }
   // ---------------------------------------------


   // The Following is an example of a basic flight
   // Currently speeds have to be +/- 0.05,0.1,0.2 or 0.5
   
   takeOff();     //take off
   sleep(5);      //Allows time for takeoff and settle before commands come in

   rotateRight(0.5); //Rotate Right at 50% speed
   sleep(2);         //For 2 Seconds

   hover();         //Hover in place
   sleep(3);        //For 3 Seconds

   land();          //Land

   // End Basic Flight Plan


   // ---- Recommended Code ------------------------

   terminateThread();   //Terminate Control Thread (should be called ONLY
                        //after landing for the last time)

   // Stops Program terminating early by waiting for control thread 
   // to terminate properly.
   if(pthread_join(ControlThread, NULL)) {
      return 1;
   }
   //---------------------------------------------

   return 0;
}
コード例 #5
0
MainWindow::~MainWindow()
{
    delete ui;
    terminateThread();
}