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

xiaoxiang 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 083c87b39a sched: Exit immediately when cpuset change to 0.
083c87b39a is described below

commit 083c87b39ac808488817ff7b1660ed7c1528cc0a
Author: zhangyuan21 <zhangyua...@xiaomi.com>
AuthorDate: Wed Oct 18 16:55:37 2023 +0800

    sched: Exit immediately when cpuset change to 0.
    
    Exit immediately when finished processing the current CPU
    if there are no other CPUs to be processed.
    
    Signed-off-by: zhangyuan21 <zhangyua...@xiaomi.com>
---
 sched/sched/sched_smp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sched/sched/sched_smp.c b/sched/sched/sched_smp.c
index f54532fe61..1b3483c71c 100644
--- a/sched/sched/sched_smp.c
+++ b/sched/sched/sched_smp.c
@@ -235,6 +235,11 @@ int nxsched_smp_call(cpu_set_t cpuset, nxsched_smp_call_t 
func,
       CPU_CLR(this_cpu(), &cpuset);
     }
 
+  if (CPU_COUNT(&cpuset) == 0)
+    {
+      goto out;
+    }
+
   /* If waiting is necessary, initialize and wait for the cookie. */
 
   if (wait)

Reply via email to