diff --git a/libraries/AP_HAL_Linux/Scheduler.cpp b/libraries/AP_HAL_Linux/Scheduler.cpp index f242745882..ddf57bbb58 100644 --- a/libraries/AP_HAL_Linux/Scheduler.cpp +++ b/libraries/AP_HAL_Linux/Scheduler.cpp @@ -83,6 +83,8 @@ void Scheduler::init() SCHED_THREAD(io, IO), }; + _main_ctx = pthread_self(); + #if !APM_BUILD_TYPE(APM_BUILD_Replay) // we don't run Replay in real-time... mlockall(MCL_CURRENT|MCL_FUTURE); diff --git a/libraries/AP_HAL_Linux/Scheduler.h b/libraries/AP_HAL_Linux/Scheduler.h index 4085743bc9..9852e626a9 100644 --- a/libraries/AP_HAL_Linux/Scheduler.h +++ b/libraries/AP_HAL_Linux/Scheduler.h @@ -114,9 +114,11 @@ private: uint64_t _stopped_clock_usec; uint64_t _last_stack_debug_msec; + pthread_t _main_ctx; Semaphore _timer_semaphore; Semaphore _io_semaphore; }; } +