From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id AB5AE38543AF; Fri, 13 Jan 2023 17:05:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB5AE38543AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673629510; bh=F7i+Hw5wuoMme1Qs9KBtBT+BrHnELKcZzynH7ahwXQA=; h=From:To:Subject:Date:From; b=ZDZjnuUtg/wP08Cl+9MK/lyFj+t4Jg2N4gDQEMoQefqa9sLE7R3rSXIzxdYhZWaVD SR54W2JCfT+PuCYxt9wBiciSe0Uo1E3pWBGO+/pewhfWIBmsX1ok5uTmXhHG5tpfn6 8ejPtN6WJFi3MCGWLQVSRxt4PiXi8v/l26KD8QAI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: testsuite: Update mutex tests for changed default mutex type X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: 52983af63174ac7e39ad7b88b9444f74c4051b4e X-Git-Newrev: 736618054c4f93fd1a81a8f53bf08a558f2f2ba2 Message-Id: <20230113170510.AB5AE38543AF@sourceware.org> Date: Fri, 13 Jan 2023 17:05:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D736618054c4= f93fd1a81a8f53bf08a558f2f2ba2 commit 736618054c4f93fd1a81a8f53bf08a558f2f2ba2 Author: Jon Turney Date: Wed Aug 31 20:32:47 2022 +0100 Cygwin: testsuite: Update mutex tests for changed default mutex type =20 Default mutex type is PTHREAD_MUTEX_NORMAL. =20 Attempting to unlock an unowned mutex of that type is specified as undefined behaviour, not returning EPERM. =20 mutex7e verfies that attempting to unlock an unowned mutex of type PTHREAD_MUTEX_ERRORCHECK returns EPERM. Diff: --- winsup/testsuite/winsup.api/pthread/mutex5.c | 2 +- winsup/testsuite/winsup.api/pthread/mutex7.c | 3 +-- winsup/testsuite/winsup.api/pthread/mutex7d.c | 3 +-- winsup/testsuite/winsup.api/pthread/mutex7n.c | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/winsup/testsuite/winsup.api/pthread/mutex5.c b/winsup/testsuit= e/winsup.api/pthread/mutex5.c index 7029da12f..6d24275f1 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) =3D=3D 0); assert(pthread_mutexattr_gettype(&mxAttr, &mxType) =3D=3D 0); - assert(mxType =3D=3D PTHREAD_MUTEX_ERRORCHECK); + assert(mxType =3D=3D PTHREAD_MUTEX_NORMAL); } =20 return 0; diff --git a/winsup/testsuite/winsup.api/pthread/mutex7.c b/winsup/testsuit= e/winsup.api/pthread/mutex7.c index d2c9f8bee..6acb12317 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) =3D=3D EBUSY); lockCount++; assert(pthread_mutex_unlock(&mutex) =3D=3D 0); - assert(pthread_mutex_unlock(&mutex) =3D=3D EPERM); =20 return 0; } diff --git a/winsup/testsuite/winsup.api/pthread/mutex7d.c b/winsup/testsui= te/winsup.api/pthread/mutex7d.c index 906d0f043..98b74fc5b 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) =3D=3D EBUSY); lockCount++; assert(pthread_mutex_unlock(&mutex) =3D=3D 0); - assert(pthread_mutex_unlock(&mutex) =3D=3D EPERM); =20 return 0; } diff --git a/winsup/testsuite/winsup.api/pthread/mutex7n.c b/winsup/testsui= te/winsup.api/pthread/mutex7n.c index e9a36fec0..a04792b61 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) =3D=3D EBUSY); lockCount++; assert(pthread_mutex_unlock(&mutex) =3D=3D 0); - assert(pthread_mutex_unlock(&mutex) =3D=3D EPERM); =20 return (void *) 555; }