AP_HAL_Linux: make in_main_thread const and override

# Conflicts:
#	libraries/AP_HAL_Linux/Scheduler.cpp
#	libraries/AP_HAL_Linux/Scheduler.h
This commit is contained in:
Andrew Tridgell 2017-10-29 18:29:54 +11:00
parent 4cb981afa6
commit 3ef150e9f7
2 changed files with 6 additions and 0 deletions

View File

@ -419,6 +419,11 @@ bool Scheduler::in_timerprocess()
return _in_timer_proc;
}
bool Scheduler::in_main_thread() const
{
return pthread_equal(pthread_self(), _main_ctx);
}
void Scheduler::_wait_all_threads()
{
int r = pthread_barrier_wait(&_initialized_barrier);

View File

@ -37,6 +37,7 @@ public:
void resume_timer_procs();
bool in_timerprocess();
bool in_main_thread() const override;
void register_timer_failsafe(AP_HAL::Proc, uint32_t period_us);