summaryrefslogtreecommitdiff
path: root/regress/lib/libc_r/pthread_mutex
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2001-11-03 04:33:49 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2001-11-03 04:33:49 +0000
commitfda395f82481595d0a1aac47e8dc70cabe17dd7e (patch)
tree7a7035aee71205602f92d1cdc4367eb51cb40417 /regress/lib/libc_r/pthread_mutex
parent8053500a21eafa9902b1f97a6b98a4cd375818bc (diff)
Fix pthread_mutex regression test... undefined behavior does not
mean != EPERM in one test, minor changes to recursive mutex test. remove printf in signal test signal handler, run test long enough to ensure signal hander is called at least twice, reduce output. Note: running these tests over a remote console may indicate bogus falures due to console output latency. Any test that takes longer than 5 seconds to complete may be flagged as a failure.
Diffstat (limited to 'regress/lib/libc_r/pthread_mutex')
-rw-r--r--regress/lib/libc_r/pthread_mutex/pthread_mutex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/regress/lib/libc_r/pthread_mutex/pthread_mutex.c b/regress/lib/libc_r/pthread_mutex/pthread_mutex.c
index 3dd62129035..311688d0259 100644
--- a/regress/lib/libc_r/pthread_mutex/pthread_mutex.c
+++ b/regress/lib/libc_r/pthread_mutex/pthread_mutex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pthread_mutex.c,v 1.2 2001/09/20 16:43:15 todd Exp $ */
+/* $OpenBSD: pthread_mutex.c,v 1.3 2001/11/03 04:33:48 marc Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors,
* proven@mit.edu All rights reserved.
@@ -109,7 +109,7 @@ test_debug_double_unlock(mutex)
CHECKr(pthread_mutex_lock(mutex));
CHECKr(pthread_mutex_unlock(mutex));
/* Posix D10 says undefined behaviour? */
- ASSERTe(pthread_mutex_unlock(mutex), != EPERM);
+ ASSERTe(pthread_mutex_unlock(mutex), != 0);
}
void
@@ -167,6 +167,7 @@ test_mutex_recursive()
pthread_mutexattr_t mutex_recursive_attr;
pthread_mutex_t mutex_recursive;
int i;
+ int j = 9;
printf("test_mutex_recursive()\n");
CHECKr(pthread_mutexattr_init(&mutex_recursive_attr));
@@ -175,13 +176,14 @@ test_mutex_recursive()
CHECKr(pthread_mutex_init(&mutex_recursive, &mutex_recursive_attr));
CHECKr(pthread_mutex_lock(&mutex_recursive));
- for (i = 0; i < 9; i++)
+ for (i = 0; i < j; i++)
CHECKr(pthread_mutex_lock(&mutex_recursive));
- for (i = 0; i < 9; i++)
+ for (i = 0; i < j; i++)
CHECKr(pthread_mutex_unlock(&mutex_recursive));
CHECKr(pthread_mutex_unlock(&mutex_recursive));
/* Posix D10 says undefined behaviour? */
ASSERTe(pthread_mutex_unlock(&mutex_recursive), != 0);
+ CHECKr(pthread_mutex_destroy(&mutex_recursive));
}
int