ostest: fix smp ostest fail

In SMP we need improve thread waiting strategy

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2023-04-18 10:28:16 +08:00 committed by Alin Jerpelea
parent f0f98c3d73
commit 5b2a89e174

View File

@ -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");