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:
   work_queue_next() uses the old work->qtime as its base (line 115), and 
nothing else sets qtime for an immediate work item. With this change a work 
item queued with delay 0 that re-arms itself with work_queue_next() gets qtime 
= delay, an expiration far in the past, so it runs back to back until qtime 
reaches the current tick. arch/sim/src/sim/sim_rptun.c (lines 500 and 452) and 
sim_rpmsg_virtio.c (lines 251 and 188) use this pattern; 
libs/libc/wqueue/work_queue.c:124 still sets qtime for delay 0.



-- 
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