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 3b3380ca012 sched/sched_critmonitor: remove duplicate preemption start 
block
3b3380ca012 is described below

commit 3b3380ca012d511da9085bc6fec56577035a6b02
Author: yushuailong <[email protected]>
AuthorDate: Tue Jul 28 10:24:51 2026 +0800

    sched/sched_critmonitor: remove duplicate preemption start block
    
    The `to->preemp_start = current` assignment when `to->lockcount > 0`
    was executed twice under CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION,
    once in the main preemption block and again after the csection block.
    Remove the redundant duplicate.
    
    Signed-off-by: yushuailong <[email protected]>
---
 sched/sched/sched_critmonitor.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/sched/sched/sched_critmonitor.c b/sched/sched/sched_critmonitor.c
index d5b9595b91c..c9992e8a748 100644
--- a/sched/sched/sched_critmonitor.c
+++ b/sched/sched/sched_critmonitor.c
@@ -454,18 +454,6 @@ void nxsched_switch_critmon(FAR struct tcb_s *from, FAR 
struct tcb_s *to)
     }
 
 #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION */
-
-#if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0
-
-  /* Did this task disable pre-emption? */
-
-  if (to->lockcount > 0)
-    {
-      /* Yes.. Save the start time */
-
-      to->premp_start = current;
-    }
-#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION */
 }
 
 void nxsched_update_critmon(FAR struct tcb_s *tcb)

Reply via email to