casaroli commented on code in PR #21036:
URL: https://github.com/apache/nuttx/pull/21036#discussion_r4391677287


##########
sched/wqueue/kwork_queue.c:
##########
@@ -84,7 +84,7 @@ static int work_qqueue(FAR struct kwork_wqueue_s *wqueue,
 
   /* Preserve regular queue timing across lock contention. */
 
-  if (!period)
+  if (!period && delay > 0)

Review Comment:
   With delay 0, `qtime` now stays 0. `work_queue_next()` adds the period to 
the old `qtime` (line 115), so a work queued with delay 0 that re-arms with 
`work_queue_next()` (`sim_rptun.c:500`/`452`, `sim_rpmsg_virtio.c:251`/`188`) 
runs back to back until it catches up with the current tick.
   
   Fix: keep setting `qtime` to the current tick for delay 0, as 
`libs/libc/wqueue/work_queue.c:124` does.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to