diff options
author | marha <marha@users.sourceforge.net> | 2011-07-18 10:33:05 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-18 10:33:05 +0200 |
commit | 88101146f2ec7d53ffb793e365f05097ffd35fd3 (patch) | |
tree | db77eef572a00c62c8d9485c4786f682e20a2fd0 /pthreads/tests/mutex8r.c | |
parent | 772373ccc8da2b2019555228f4972cc0c5a885a4 (diff) | |
download | vcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.tar.gz vcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.tar.bz2 vcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.zip |
cvs version of pthreads
Diffstat (limited to 'pthreads/tests/mutex8r.c')
-rw-r--r-- | pthreads/tests/mutex8r.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pthreads/tests/mutex8r.c b/pthreads/tests/mutex8r.c index d1328cad9..434b9af8e 100644 --- a/pthreads/tests/mutex8r.c +++ b/pthreads/tests/mutex8r.c @@ -44,7 +44,7 @@ #include "test.h" #include <sys/timeb.h> -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_RECURSIVE) == 0); assert(pthread_mutexattr_gettype(&mxAttr, &mxType) == 0); assert(mxType == PTHREAD_MUTEX_RECURSIVE); @@ -92,6 +96,8 @@ main() assert(pthread_mutex_unlock(&mutex) == 0); + END_MUTEX_STALLED_ROBUST(mxAttr) + return 0; } |