px4_work_queue: sem_wait add loop as the wait may be interrupted by a signal

This commit is contained in:
Daniel Agar
2020-04-05 10:12:24 -04:00
committed by Beat Küng
parent 9404b19906
commit 1d164c0dbd
2 changed files with 4 additions and 2 deletions
@@ -84,7 +84,8 @@ private:
void work_unlock() { leave_critical_section(_flags); }
irqstate_t _flags;
#else
void work_lock() { px4_sem_wait(&_qlock); }
// loop as the wait may be interrupted by a signal
void work_lock() { do {} while (px4_sem_wait(&_qlock) != 0); }
void work_unlock() { px4_sem_post(&_qlock); }
px4_sem_t _qlock;
#endif