posix: HRT hrt_lock() sem_wait try again if error returned

This commit is contained in:
Daniel Agar
2022-04-09 18:45:49 -04:00
parent 10f927ae2b
commit 1d66f2cf83
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ int hrt_work_queue(struct work_s *work, worker_t worker, void *arg, uint32_t del
work->qtime = hrt_absolute_time(); /* Time work queued */
//PX4_INFO("hrt work_queue adding work delay=%u time=%lu", delay, work->qtime);
dq_addlast((dq_entry_t *)work, &wqueue->q);
dq_addlast(&work->dq, &wqueue->q);
if (px4_getpid() != wqueue->pid) { /* only need to wake up if called from a different thread */
#ifdef __PX4_QURT
+1 -1
View File
@@ -155,7 +155,7 @@ static void hrt_work_process()
if (elapsed >= work->delay) {
/* Remove the ready-to-execute work from the list */
(void)dq_rem((struct dq_entry_s *) & (work->dq), &(wqueue->q));
(void)dq_rem((dq_entry_t *)&work->dq, &wqueue->q);
//PX4_INFO("Dequeued work=%p", work);
/* Extract the work description from the entry (in case the work
@@ -103,7 +103,7 @@ void hrt_work_cancel(struct work_s *work)
* mark as availalbe (i.e., the worker field is nullified).
*/
dq_rem((dq_entry_t *)work, &wqueue->q);
dq_rem(&work->dq, &wqueue->q);
work->worker = NULL;
}