diff --git a/src/platforms/posix/px4_layer/px4_posix_impl.cpp b/src/platforms/posix/px4_layer/px4_posix_impl.cpp index 19747556a9..a3ab78df55 100644 --- a/src/platforms/posix/px4_layer/px4_posix_impl.cpp +++ b/src/platforms/posix/px4_layer/px4_posix_impl.cpp @@ -49,6 +49,7 @@ #include "hrt_work.h" #include #include "px4_time.h" +#include extern pthread_t _shell_task_id; @@ -86,6 +87,13 @@ void init(int argc, char *argv[], const char *app_name) printf("Ready to fly.\n"); printf("\n"); printf("\n"); + + // set the threads name + #ifdef __PX4_DARWIN + (void)pthread_setname_np(app_name); + #else + (void)pthread_setname_np(pthread_self(), app_name); + #endif } uint64_t get_time_micros()