src/modules/land_detector/land_detector_main.cpp
/**
* Stop the task, force killing it if it doesn't stop by itself
**/
Stop the task, force killing it if it doesn't stop by itself
Stop the task force killing it if it doesn ' t stop by itself
static void land_detector_stop()
{
	if (land_detector_task == nullptr || _landDetectorTaskID == -1) {
		errx(1, "not running");
		return;
	}
	land_detector_task->shutdown();
	int i = 0;
	do {
		usleep(20000);
		if (++i > 50) {
			task_delete(_landDetectorTaskID);
			break;
		}
	} while (land_detector_task->isRunning());
	delete land_detector_task;
	land_detector_task = nullptr;
	_landDetectorTaskID = -1;
	errx(0, "land_detector has been stopped");
}
static void land_detector_stop ( ) { if ( land_detector_task == nullptr || _landDetectorTaskID == -1 ) { errx ( 1 , " " ) ; return ; } land_detector_task -> shutdown ( ) ; int i = 0 ; do { usleep ( 20000 ) ; if ( ++ i > 50 ) { task_delete ( _landDetectorTaskID ) ; break ; } } while ( land_detector_task -> isRunning ( ) ) ; delete land_detector_task ; land_detector_task = nullptr ; _landDetectorTaskID = -1 ; errx ( 0 , " " ) ; }
Stop the task, force killing it if it doesn't stop by itself
Stop the task force killing it if it doesn ' t stop by itself
//Wait for task to die /* wait 20ms */ /* if we have given up, kill it */