diff options
author | marha <marha@users.sourceforge.net> | 2011-07-18 10:51:09 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-18 10:51:09 +0200 |
commit | 3c0d2312573b81e3067bea610a58b1940c075e05 (patch) | |
tree | 3f025a27d813374f225957801226aa8ee829a33a /pthreads/tests/benchtest2.c | |
parent | ba033884541714680fd7552ab9d6c8817650f7d8 (diff) | |
parent | 88101146f2ec7d53ffb793e365f05097ffd35fd3 (diff) | |
download | vcxsrv-3c0d2312573b81e3067bea610a58b1940c075e05.tar.gz vcxsrv-3c0d2312573b81e3067bea610a58b1940c075e05.tar.bz2 vcxsrv-3c0d2312573b81e3067bea610a58b1940c075e05.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
X11/Xfuncproto.h.in
X11/configure.ac
X11/keysymdef.h
freetype/include/freetype/internal/pcftypes.h
freetype/src/cache/ftcbasic.c
freetype/src/cache/ftccmap.c
mesalib/src/glsl/ir.h
mesalib/src/glsl/link_functions.cpp
mesalib/src/mesa/main/dlist.c
mesalib/src/mesa/program/prog_optimize.c
mesalib/src/mesa/state_tracker/st_program.c
pthreads/Makefile
Diffstat (limited to 'pthreads/tests/benchtest2.c')
-rw-r--r-- | pthreads/tests/benchtest2.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/pthreads/tests/benchtest2.c b/pthreads/tests/benchtest2.c index d92bb3c1a..10f3d0ee8 100644 --- a/pthreads/tests/benchtest2.c +++ b/pthreads/tests/benchtest2.c @@ -60,23 +60,23 @@ CRITICAL_SECTION cs1, cs2; pthread_mutexattr_t ma; long durationMilliSecs; long overHeadMilliSecs = 0; -struct _timeb currSysTimeStart; -struct _timeb currSysTimeStop; +PTW32_STRUCT_TIMEB currSysTimeStart; +PTW32_STRUCT_TIMEB currSysTimeStop; pthread_t worker; int running = 0; -#define GetDurationMilliSecs(_TStart, _TStop) ((_TStop.time*1000+_TStop.millitm) \ - - (_TStart.time*1000+_TStart.millitm)) +#define GetDurationMilliSecs(_TStart, _TStop) ((long)((_TStop.time*1000+_TStop.millitm) \ + - (_TStart.time*1000+_TStart.millitm))) /* * Dummy use of j, otherwise the loop may be removed by the optimiser * when doing the overhead timing with an empty loop. */ #define TESTSTART \ - { int i, j = 0, k = 0; _ftime(&currSysTimeStart); for (i = 0; i < ITERATIONS; i++) { j++; + { int i, j = 0, k = 0; PTW32_FTIME(&currSysTimeStart); for (i = 0; i < ITERATIONS; i++) { j++; #define TESTSTOP \ - }; _ftime(&currSysTimeStop); if (j + k == i) j++; } + }; PTW32_FTIME(&currSysTimeStop); if (j + k == i) j++; } void * @@ -289,15 +289,31 @@ main (int argc, char *argv[]) * Now we can start the actual tests */ #ifdef PTW32_MUTEX_TYPES - runTest("PTHREAD_MUTEX_DEFAULT (W9x,WNT)", PTHREAD_MUTEX_DEFAULT); + runTest("PTHREAD_MUTEX_DEFAULT", PTHREAD_MUTEX_DEFAULT); - runTest("PTHREAD_MUTEX_NORMAL (W9x,WNT)", PTHREAD_MUTEX_NORMAL); + runTest("PTHREAD_MUTEX_NORMAL", PTHREAD_MUTEX_NORMAL); - runTest("PTHREAD_MUTEX_ERRORCHECK (W9x,WNT)", PTHREAD_MUTEX_ERRORCHECK); + runTest("PTHREAD_MUTEX_ERRORCHECK", PTHREAD_MUTEX_ERRORCHECK); - runTest("PTHREAD_MUTEX_RECURSIVE (W9x,WNT)", PTHREAD_MUTEX_RECURSIVE); + runTest("PTHREAD_MUTEX_RECURSIVE", PTHREAD_MUTEX_RECURSIVE); #else - runTest("Blocking locks", 0); + runTest("Non-blocking lock", 0); +#endif + + printf( ".............................................................................\n"); + + pthread_mutexattr_setrobust(&ma, PTHREAD_MUTEX_ROBUST); + +#ifdef PTW32_MUTEX_TYPES + runTest("PTHREAD_MUTEX_DEFAULT (Robust)", PTHREAD_MUTEX_DEFAULT); + + runTest("PTHREAD_MUTEX_NORMAL (Robust)", PTHREAD_MUTEX_NORMAL); + + runTest("PTHREAD_MUTEX_ERRORCHECK (Robust)", PTHREAD_MUTEX_ERRORCHECK); + + runTest("PTHREAD_MUTEX_RECURSIVE (Robust)", PTHREAD_MUTEX_RECURSIVE); +#else + runTest("Non-blocking lock", 0); #endif printf( "=============================================================================\n"); |