Module Name: src
Committed By: ad
Date: Wed Jun 10 21:46:50 UTC 2020
Modified Files:
src/tests/lib/libpthread: t_cond.c
Log Message:
Adjust cond_timedwait_race to take account of spurious wakeups (which are
completely legit).
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libpthread/t_cond.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libpthread/t_cond.c
diff -u src/tests/lib/libpthread/t_cond.c:1.7 src/tests/lib/libpthread/t_cond.c:1.8
--- src/tests/lib/libpthread/t_cond.c:1.7 Sun Jul 3 14:24:59 2016
+++ src/tests/lib/libpthread/t_cond.c Wed Jun 10 21:46:50 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cond.c,v 1.7 2016/07/03 14:24:59 christos Exp $ */
+/* $NetBSD: t_cond.c,v 1.8 2020/06/10 21:46:50 ad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_cond.c,v 1.7 2016/07/03 14:24:59 christos Exp $");
+__RCSID("$NetBSD: t_cond.c,v 1.8 2020/06/10 21:46:50 ad Exp $");
#include <sys/time.h>
@@ -329,7 +329,7 @@ pthread_cond_timedwait_func(void *arg)
* Sometimes we catch ESRCH.
* This should never happen.
*/
- ATF_REQUIRE(rv == ETIMEDOUT);
+ ATF_REQUIRE(rv == ETIMEDOUT || rv == 0);
PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
}
}