libc/winsup/testsuite/winsup.api/pthread/mutex5.c
Christopher Faylor 452e5c7297 * winsup.api/pthread/cancel2.c: Use explicit initializer for mutex.
* winsup.api/pthread/mutex4.c (main): Ditto.
* winsup.api/pthread/mutex5.c: Reflect change in cygwin default mutex type.
* winsup.api/pthread/mutex6d.c: Ditto.
2005-06-11 04:59:53 +00:00

31 lines
702 B
C

/*
* mutex5.c
*
* Confirm the equality/inequality of the various mutex types,
* and the default not-set value.
*/
#include "test.h"
static pthread_mutexattr_t mxAttr;
int
main()
{
int mxType = -1;
int success = 0; /* Use to quell GNU compiler warnings. */
assert(success = PTHREAD_MUTEX_DEFAULT == PTHREAD_MUTEX_NORMAL);
assert(success = PTHREAD_MUTEX_DEFAULT != PTHREAD_MUTEX_RECURSIVE);
assert(success = PTHREAD_MUTEX_RECURSIVE != PTHREAD_MUTEX_ERRORCHECK);
if (success == success)
{
assert(pthread_mutexattr_init(&mxAttr) == 0);
assert(pthread_mutexattr_gettype(&mxAttr, &mxType) == 0);
assert(mxType == PTHREAD_MUTEX_ERRORCHECK);
}
return 0;
}