AP_HAL_Linux: Scheduler: move rpcmem initialization to setup phase

This was the only piece remaining in the timer thread that was used only
to setup the thread.
This commit is contained in:
Lucas De Marchi 2016-02-03 02:18:44 -02:00
parent 0282ebb8ff
commit 860d5aaf84

View File

@ -280,11 +280,6 @@ void Scheduler::_run_timers()
void Scheduler::_timer_task() void Scheduler::_timer_task()
{ {
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_QFLIGHT
printf("Initialising rpcmem\n");
rpcmem_init();
#endif
/* /*
this aims to run at an average of 1kHz, so that it can be used this aims to run at an average of 1kHz, so that it can be used
to drive 1kHz processes without drift to drive 1kHz processes without drift
@ -431,6 +426,14 @@ void Scheduler::stop_clock(uint64_t time_usec)
bool Scheduler::SchedulerThread::_run() bool Scheduler::SchedulerThread::_run()
{ {
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_QFLIGHT
if (_sched._timer_thread.is_current_thread()) {
/* make rpcmem initialization on timer thread */
printf("Initialising rpcmem\n");
rpcmem_init();
}
#endif
_sched._wait_all_threads(); _sched._wait_all_threads();
return Thread::_run(); return Thread::_run();