This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 9264f0d7706 sched/wqueue: Skip tick read for immediate work
9264f0d7706 is described below

commit 9264f0d7706c967acb86baea017924ca003d9109
Author: chao an <[email protected]>
AuthorDate: Tue Oct 27 17:33:46 2026 +0800

    sched/wqueue: Skip tick read for immediate work
    
    Avoid calculating an absolute expiration time for immediate work items
    because they are queued directly on the expired list and do not use the
    pending timer ordering.
    
    Signed-off-by: chao an <[email protected]>
---
 sched/wqueue/kwork_queue.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sched/wqueue/kwork_queue.c b/sched/wqueue/kwork_queue.c
index a4a349951f5..b7798f5bf94 100644
--- a/sched/wqueue/kwork_queue.c
+++ b/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)
     {
       expected = clock_delay2abstick(delay);
     }
@@ -112,6 +112,11 @@ static int work_qqueue(FAR struct kwork_wqueue_s *wqueue,
 
   if (period)
     {
+      if (work->qtime == 0)
+        {
+          work->qtime = clock_systime_ticks();
+        }
+
       work->qtime += delay;
     }
   else

Reply via email to