aboutsummaryrefslogtreecommitdiff
path: root/pthreads/tests/benchtest5.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-07-18 10:33:05 +0200
committermarha <marha@users.sourceforge.net>2011-07-18 10:33:05 +0200
commit88101146f2ec7d53ffb793e365f05097ffd35fd3 (patch)
treedb77eef572a00c62c8d9485c4786f682e20a2fd0 /pthreads/tests/benchtest5.c
parent772373ccc8da2b2019555228f4972cc0c5a885a4 (diff)
downloadvcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.tar.gz
vcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.tar.bz2
vcxsrv-88101146f2ec7d53ffb793e365f05097ffd35fd3.zip
cvs version of pthreads
Diffstat (limited to 'pthreads/tests/benchtest5.c')
-rw-r--r--pthreads/tests/benchtest5.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/pthreads/tests/benchtest5.c b/pthreads/tests/benchtest5.c
index 7700fdeaa..d262baf11 100644
--- a/pthreads/tests/benchtest5.c
+++ b/pthreads/tests/benchtest5.c
@@ -53,25 +53,25 @@
sem_t sema;
HANDLE w32sema;
-struct _timeb currSysTimeStart;
-struct _timeb currSysTimeStop;
+PTW32_STRUCT_TIMEB currSysTimeStart;
+PTW32_STRUCT_TIMEB currSysTimeStop;
long durationMilliSecs;
long overHeadMilliSecs = 0;
int one = 1;
int zero = 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
@@ -115,7 +115,7 @@ main (int argc, char *argv[])
*/
assert((w32sema = CreateSemaphore(NULL, (long) 0, (long) ITERATIONS, NULL)) != 0);
TESTSTART
- assert(ReleaseSemaphore(w32sema, 1, NULL) != zero);
+ assert((ReleaseSemaphore(w32sema, 1, NULL),1) == one);
TESTSTOP
assert(CloseHandle(w32sema) != 0);
@@ -124,7 +124,7 @@ main (int argc, char *argv[])
assert((w32sema = CreateSemaphore(NULL, (long) ITERATIONS, (long) ITERATIONS, NULL)) != 0);
TESTSTART
- assert(WaitForSingleObject(w32sema, INFINITE) == WAIT_OBJECT_0);
+ assert((WaitForSingleObject(w32sema, INFINITE),1) == one);
TESTSTOP
assert(CloseHandle(w32sema) != 0);
@@ -133,7 +133,7 @@ main (int argc, char *argv[])
assert(sem_init(&sema, 0, 0) == 0);
TESTSTART
- assert(sem_post(&sema) == zero);
+ assert((sem_post(&sema),1) == one);
TESTSTOP
assert(sem_destroy(&sema) == 0);
@@ -142,7 +142,7 @@ main (int argc, char *argv[])
assert(sem_init(&sema, 0, ITERATIONS) == 0);
TESTSTART
- assert(sem_wait(&sema) == zero);
+ assert((sem_wait(&sema),1) == one);
TESTSTOP
assert(sem_destroy(&sema) == 0);