From 88101146f2ec7d53ffb793e365f05097ffd35fd3 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 18 Jul 2011 10:33:05 +0200 Subject: cvs version of pthreads --- pthreads/tests/mutex8e.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'pthreads/tests/mutex8e.c') diff --git a/pthreads/tests/mutex8e.c b/pthreads/tests/mutex8e.c index b99d24edd..a36056673 100644 --- a/pthreads/tests/mutex8e.c +++ b/pthreads/tests/mutex8e.c @@ -44,7 +44,7 @@ #include "test.h" #include -static int lockCount = 0; +static int lockCount; static pthread_mutex_t mutex; static pthread_mutexattr_t mxAttr; @@ -52,12 +52,12 @@ static pthread_mutexattr_t mxAttr; void * locker(void * arg) { struct timespec abstime = { 0, 0 }; - struct _timeb currSysTime; + PTW32_STRUCT_TIMEB currSysTime; const DWORD NANOSEC_PER_MILLISEC = 1000000; - _ftime(&currSysTime); + PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; @@ -76,6 +76,10 @@ main() int mxType = -1; assert(pthread_mutexattr_init(&mxAttr) == 0); + + BEGIN_MUTEX_STALLED_ROBUST(mxAttr) + + lockCount = 0; assert(pthread_mutexattr_settype(&mxAttr, PTHREAD_MUTEX_ERRORCHECK) == 0); assert(pthread_mutexattr_gettype(&mxAttr, &mxType) == 0); assert(mxType == PTHREAD_MUTEX_ERRORCHECK); @@ -92,6 +96,8 @@ main() assert(pthread_mutex_unlock(&mutex) == 0); + END_MUTEX_STALLED_ROBUST(mxAttr) + return 0; } -- cgit v1.2.3