You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2021/07/02 14:19:26 UTC

[incubator-nuttx] branch master updated: sim/smp: fix smp can't start, caused by signal too busy

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f479ca9  sim/smp: fix smp can't start, caused by signal too busy
f479ca9 is described below

commit f479ca9096657b91ba6b411ad1b55db34f395856
Author: ligd <li...@xiaomi.com>
AuthorDate: Fri Jul 2 20:56:05 2021 +0800

    sim/smp: fix smp can't start, caused by signal too busy
    
    Change-Id: Ia9cad04759a869f9bed871fa0acd002115eefb0a
    Signed-off-by: ligd <li...@xiaomi.com>
---
 arch/sim/src/sim/up_hosttime.c | 2 +-
 arch/sim/src/sim/up_simsmp.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/sim/src/sim/up_hosttime.c b/arch/sim/src/sim/up_hosttime.c
index 549c687..9d1fb5e 100644
--- a/arch/sim/src/sim/up_hosttime.c
+++ b/arch/sim/src/sim/up_hosttime.c
@@ -66,7 +66,7 @@ uint64_t host_gettime(bool rtc)
 
 void host_sleep(uint64_t nsec)
 {
-  usleep(nsec / 1000);
+  usleep((nsec + 999) / 1000);
 }
 
 /****************************************************************************
diff --git a/arch/sim/src/sim/up_simsmp.c b/arch/sim/src/sim/up_simsmp.c
index fd7305c..90ff1cb 100644
--- a/arch/sim/src/sim/up_simsmp.c
+++ b/arch/sim/src/sim/up_simsmp.c
@@ -148,7 +148,7 @@ static void *sim_host_timer_handler(void *arg)
 
   while (g_nx_initstate < 5)
     {
-      host_sleep(10 * 1000); /* 10ms */
+      host_sleep(10 * 1000 * 1000); /* 10ms */
     }
 
   /* Send a periodic timer event to CPU0 */
@@ -156,7 +156,7 @@ static void *sim_host_timer_handler(void *arg)
   while (1)
     {
       pthread_kill(g_cpu_thread[0], SIGUSR1);
-      host_sleep(10 * 1000); /* 10ms */
+      host_sleep(10 * 1000 * 1000); /* 10ms */
     }
 
   return NULL;