You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2023/04/24 07:56:01 UTC

[nuttx-apps] 02/02: ostest: fix smp ostest fail

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

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

commit 5b2a89e174a4af15c1cfa97dd883d0ff5e8794b1
Author: hujun5 <hu...@xiaomi.com>
AuthorDate: Tue Apr 18 10:28:16 2023 +0800

    ostest:  fix smp ostest fail
    
    In SMP we need improve thread waiting strategy
    
    Signed-off-by: hujun5 <hu...@xiaomi.com>
---
 testing/ostest/robust.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/testing/ostest/robust.c b/testing/ostest/robust.c
index f2ed48569..9217a279f 100644
--- a/testing/ostest/robust.c
+++ b/testing/ostest/robust.c
@@ -202,6 +202,14 @@ void robust_test(void)
       nerrors++;
     }
 
+  /* Make sure waiter exit completely */
+
+  do
+    {
+      sleep(1);
+    }
+  while (kill(g_robust_mutex.pid, 0) == 0 || errno != ESRCH);
+
   /* Make the mutex consistent and try again.  It should succeed this time. */
 
   printf("robust_test: Make the mutex consistent again.\n");