mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-18 23:12:15 +08:00
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.
This commit is contained in:
parent
52983af631
commit
736618054c
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user