From b170467a1dc084cf8ead4f8e53fdfb182552b027 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 1 Dec 2015 12:04:53 +0100 Subject: [PATCH] HRT thread: Set thread name --- src/platforms/posix/work_queue/hrt_thread.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platforms/posix/work_queue/hrt_thread.c b/src/platforms/posix/work_queue/hrt_thread.c index 5711aa7d6d..c7f5e7c22b 100644 --- a/src/platforms/posix/work_queue/hrt_thread.c +++ b/src/platforms/posix/work_queue/hrt_thread.c @@ -119,6 +119,14 @@ static void hrt_work_process() uint32_t remaining; uint32_t next; + int rv; + // set the threads name + #ifdef __PX4_DARWIN + rv = pthread_setname_np("HRT"); + #else + rv = pthread_setname_np(pthread_self(), "HRT"); + #endif + /* Then process queued work. We need to keep interrupts disabled while * we process items in the work list. */