mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 00:43:34 +08:00
Add daemon mode to posix build
In order to use upstart to run PX4 it needs to run in daemon mode. Added ability to test if a task is running in order to gracefully shut down muorb. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -280,6 +280,17 @@ void px4_show_tasks()
|
||||
|
||||
}
|
||||
|
||||
bool px4_task_is_running(const char *taskname)
|
||||
{
|
||||
int idx;
|
||||
for (idx=0; idx < PX4_MAX_TASKS; idx++)
|
||||
{
|
||||
if (taskmap[idx].isused && (strcmp(taskmap[idx].name.c_str(), taskname) == 0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
__BEGIN_DECLS
|
||||
|
||||
unsigned long px4_getpid()
|
||||
|
||||
Reference in New Issue
Block a user