aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2022-08-31 20:32:47 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2023-01-13 17:03:56 +0000
commit736618054c4f93fd1a81a8f53bf08a558f2f2ba2 (patch)
treefe8084ff69713c00920b47539b2800da76399d42 /winsup
parent52983af63174ac7e39ad7b88b9444f74c4051b4e (diff)
downloadnewlib-736618054c4f93fd1a81a8f53bf08a558f2f2ba2.zip
newlib-736618054c4f93fd1a81a8f53bf08a558f2f2ba2.tar.gz
newlib-736618054c4f93fd1a81a8f53bf08a558f2f2ba2.tar.bz2
Cygwin: testsuite: Update mutex tests for changed default mutex type
Default mutex type is PTHREAD_MUTEX_NORMAL. Attempting to unlock an unowned mutex of that type is specified as undefined behaviour, not returning EPERM. mutex7e verfies that attempting to unlock an unowned mutex of type PTHREAD_MUTEX_ERRORCHECK returns EPERM.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/testsuite/winsup.api/pthread/mutex5.c2
-rw-r--r--winsup/testsuite/winsup.api/pthread/mutex7.c3
-rw-r--r--winsup/testsuite/winsup.api/pthread/mutex7d.c3
-rw-r--r--winsup/testsuite/winsup.api/pthread/mutex7n.c1
4 files changed, 3 insertions, 6 deletions
diff --git a/winsup/testsuite/winsup.api/pthread/mutex5.c b/winsup/testsuite/winsup.api/pthread/mutex5.c
index 7029da1..6d24275 100644
--- a/winsup/testsuite/winsup.api/pthread/mutex5.c
+++ b/winsup/testsuite/winsup.api/pthread/mutex5.c
@@ -23,7 +23,7 @@ main()
{
assert(pthread_mutexattr_init(&mxAttr) == 0);
assert(pthread_mutexattr_gettype(&mxAttr, &mxType) == 0);
- assert(mxType == PTHREAD_MUTEX_ERRORCHECK);
+ assert(mxType == PTHREAD_MUTEX_NORMAL);
}
return 0;
diff --git a/winsup/testsuite/winsup.api/pthread/mutex7.c b/winsup/testsuite/winsup.api/pthread/mutex7.c
index d2c9f8b..6acb123 100644
--- a/winsup/testsuite/winsup.api/pthread/mutex7.c
+++ b/winsup/testsuite/winsup.api/pthread/mutex7.c
@@ -2,7 +2,7 @@
* mutex7.c
*
* Test the default (type not set) mutex type.
- * Should be the same as PTHREAD_MUTEX_ERRORCHECK.
+ * Should be the same as PTHREAD_MUTEX_NORMAL.
* Thread locks then trylocks mutex (attempted recursive lock).
* The thread should lock first time and EBUSY second time.
*
@@ -25,7 +25,6 @@ void * locker(void * arg)
assert(pthread_mutex_trylock(&mutex) == EBUSY);
lockCount++;
assert(pthread_mutex_unlock(&mutex) == 0);
- assert(pthread_mutex_unlock(&mutex) == EPERM);
return 0;
}
diff --git a/winsup/testsuite/winsup.api/pthread/mutex7d.c b/winsup/testsuite/winsup.api/pthread/mutex7d.c
index 906d0f0..98b74fc 100644
--- a/winsup/testsuite/winsup.api/pthread/mutex7d.c
+++ b/winsup/testsuite/winsup.api/pthread/mutex7d.c
@@ -2,7 +2,7 @@
* mutex7d.c
*
* Test the default (type not set) mutex type.
- * Should be the same as PTHREAD_MUTEX_ERRORCHECK.
+ * Should be the same as PTHREAD_MUTEX_NORMAL.
* Thread locks then trylocks mutex (attempted recursive lock).
* The thread should lock first time and EBUSY second time.
*
@@ -25,7 +25,6 @@ void * locker(void * arg)
assert(pthread_mutex_trylock(&mutex) == EBUSY);
lockCount++;
assert(pthread_mutex_unlock(&mutex) == 0);
- assert(pthread_mutex_unlock(&mutex) == EPERM);
return 0;
}
diff --git a/winsup/testsuite/winsup.api/pthread/mutex7n.c b/winsup/testsuite/winsup.api/pthread/mutex7n.c
index e9a36fe..a04792b 100644
--- a/winsup/testsuite/winsup.api/pthread/mutex7n.c
+++ b/winsup/testsuite/winsup.api/pthread/mutex7n.c
@@ -29,7 +29,6 @@ void * locker(void * arg)
assert(pthread_mutex_trylock(&mutex) == EBUSY);
lockCount++;
assert(pthread_mutex_unlock(&mutex) == 0);
- assert(pthread_mutex_unlock(&mutex) == EPERM);
return (void *) 555;
}