From 5b2a89e174a4af15c1cfa97dd883d0ff5e8794b1 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Tue, 18 Apr 2023 10:28:16 +0800 Subject: [PATCH] ostest: fix smp ostest fail In SMP we need improve thread waiting strategy Signed-off-by: hujun5 --- 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");