diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-13 08:46:49 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-13 08:46:49 +0000 |
commit | 737f07cf419a31875a0cfa3dc414114afb00f08d (patch) | |
tree | a1a97060a4565e19863f394a3366977dd192d5b0 /contrib/netbsd-tests/lib/libpthread/t_condwait.c | |
parent | 9ee7d5b9735c8fc021ba019295da87cc6c3f0b40 (diff) | |
download | FreeBSD-src-737f07cf419a31875a0cfa3dc414114afb00f08d.zip FreeBSD-src-737f07cf419a31875a0cfa3dc414114afb00f08d.tar.gz |
MFC r311265,r311274:
r311265:
fpu: ensure calls to pthread_create succeed and test sched_yield to make
sure it returns 0
sched_yield tests for values returning 0 of type int and sched_yield is
of type long, so the test is a mismatch
CID: 1254953, 1254954, 1254965, 1254966
r311274:
run: ensure pthread_condattr_{init,setclock} is successful
CID: 1268631, 1268633
Diffstat (limited to 'contrib/netbsd-tests/lib/libpthread/t_condwait.c')
-rw-r--r-- | contrib/netbsd-tests/lib/libpthread/t_condwait.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libpthread/t_condwait.c b/contrib/netbsd-tests/lib/libpthread/t_condwait.c index 17bbb89..99793d0 100644 --- a/contrib/netbsd-tests/lib/libpthread/t_condwait.c +++ b/contrib/netbsd-tests/lib/libpthread/t_condwait.c @@ -42,6 +42,8 @@ __RCSID("$NetBSD: t_condwait.c,v 1.4 2013/04/12 17:18:11 christos Exp $"); #ifdef __FreeBSD__ #include <sys/time.h> + +#include "h_common.h" #endif #define WAITTIME 2 /* Timeout wait secound */ @@ -60,8 +62,13 @@ run(void *param) clck = *(clockid_t *)param; +#ifdef __FreeBSD__ + PTHREAD_REQUIRE(pthread_condattr_init(&attr)); + PTHREAD_REQUIRE(pthread_condattr_setclock(&attr, clck)); +#else pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, clck); /* MONOTONIC or MONOTONIC */ +#endif pthread_cond_init(&cond, &attr); ATF_REQUIRE_EQ((ret = pthread_mutex_lock(&m)), 0); |