logger: move pthread_t cast to pid_t into watchdog_initialize

avoids compile error on OSX, trying to cast pthread_t to pid_t
This commit is contained in:
Beat Küng
2018-05-03 13:18:45 +02:00
committed by Lorenz Meier
parent f2703abce0
commit b8a94bf8d4
3 changed files with 7 additions and 5 deletions
+4 -1
View File
@@ -133,10 +133,13 @@ bool watchdog_update(watchdog_data_t &watchdog_data)
}
void watchdog_initialize(const pid_t pid_logger_main, const pid_t pid_logger_writer, watchdog_data_t &watchdog_data)
void watchdog_initialize(const pid_t pid_logger_main, const pthread_t writer_thread, watchdog_data_t &watchdog_data)
{
#ifdef __PX4_NUTTX
// The pthread_t ID is equal to the PID on NuttX
const pthread_t pid_logger_writer = writer_thread;
sched_lock(); // need to lock the tcb access
for (int i = 0; i < CONFIG_MAX_TASKS; i++) {