From 0c2cb3fb140fb0d12586587001cb1ca238cf8c25 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 29 Dec 2000 07:08:44 +0000 Subject: ./ChangeLog: 2000-12-29 Ross Johnson * Makefile: Back-out "for" loops which don't work. * GNUmakefile: Remove the fake.a target; add the "realclean" target; don't remove built libs under the "clean" target. * config.h: Add a guard against multiple inclusion. * semaphore.h: Add some defines from config.h to make semaphore.h independent of config.h when building apps. * pthread.h (_errno): Back-out previous fix until we know how to fix it properly. * implement.h (lockCount): Add missing element to pthread_mutex_t_. * sync.c (pthread_join): Spelling fix in comment. * private.c (ptw32_threadStart): Reset original termination function (C++). (ptw32_threadStart): Cleanup detached threads early in case the library is statically linked. (ptw32_callUserDestroyRoutines): Remove [SEH] __try block from destructor call so that unhandled exceptions will be passed through to the system; call terminate() from [C++] try block for the same reason. * tsd.c (pthread_getspecific): Add comment. * mutex.c (pthread_mutex_init): Initialise new elements in pthread_mutex_t. (pthread_mutex_unlock): Invert "pthread_equal()" test. 2000-12-28 Ross Johnson * semaphore.c (mode_t): Use ifndef HAVE_MODE_T to include definition. * config.h.in (HAVE_MODE_T): Added. (_UWIN): Start adding defines for the UWIN package. ./tests/ChangeLog: 2000-12-29 Ross Johnson * GNUmakefile: Add mutex4 test; ensure libpthreadw32.a is removed for "clean" target. * Makefile: Add mutex4 test. * exception3.c: Remove SEH code; automatically pass the test under SEH (which is an N/A environment). * mutex4.c: New test. * eyal1.c (do_work_unit): Add a dummy "if" to force the optimiser to retain code; reduce thread work loads. * condvar8.c (main): Add an additional "assert" for debugging; increase pthread_cond_signal timeout. --- tests/eyal1.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/eyal1.c') diff --git a/tests/eyal1.c b/tests/eyal1.c index a9ba909..6954c3b 100644 --- a/tests/eyal1.c +++ b/tests/eyal1.c @@ -63,7 +63,7 @@ typedef struct thread_control TC; static TC *tcs = NULL; static int nthreads = 10; -static int nwork = 1000; +static int nwork = 100; static int quiet = 0; static int todo = -1; @@ -86,7 +86,7 @@ die (int ret) } -static void +static double waste_time (int n) { int i; @@ -98,6 +98,7 @@ waste_time (int n) { f = 2 * f * f / (f * f); } + return f; } static int @@ -105,6 +106,7 @@ do_work_unit (int who, int n) { int i; static int nchars = 0; + double f = 0.0; if (quiet) i = 0; @@ -131,7 +133,11 @@ do_work_unit (int who, int n) } n = rand () % 10000; /* ignore incoming 'n' */ - waste_time (n); + f = waste_time (n); + + /* This prevents the statement above from being optimised out */ + if (f > 0.0) + return(n); return (n); } -- cgit v1.2.3