From d14156f2c1d4a9db64cfef0370883db8930e3a6b Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 2 Mar 2002 05:00:44 +0000 Subject: Changes to documentation and makefiles. --- tests/GNUmakefile | 4 +-- tests/Makefile | 6 ++-- tests/exit4.c | 104 ------------------------------------------------------ 3 files changed, 3 insertions(+), 111 deletions(-) delete mode 100644 tests/exit4.c (limited to 'tests') diff --git a/tests/GNUmakefile b/tests/GNUmakefile index 9a0902e..cdae2d9 100644 --- a/tests/GNUmakefile +++ b/tests/GNUmakefile @@ -83,8 +83,7 @@ TESTS = loadfree \ priority1 priority2 inherit1 \ spin1 spin2 spin3 spin4 \ barrier1 barrier2 barrier3 barrier4 barrier5 \ - exception1 exception2 exception3 \ - exit4 + exception1 exception2 exception3 BENCHTESTS = \ benchtest1 benchtest2 benchtest3 benchtest4 benchtest5 @@ -177,7 +176,6 @@ exception3.pass: exception2.pass exit1.pass: exit2.pass: create1.pass exit3.pass: create1.pass -exit4.pass: exit3.pass eyal1.pass: tsd1.pass inherit1.pass: join1.pass join0.pass: create1.pass diff --git a/tests/Makefile b/tests/Makefile index f684f31..a3fa7f3 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -57,7 +57,7 @@ VCDLL = pthreadVC.dll # C++ Exceptions in application - using VC version of pthreads dll VCXFLAGS = /GX /TP /D__CLEANUP_C -CFLAGS= $(OPTIM) /W3 /WX /MT /nologo /Yd /Zi -D_WIN32_WINNT=0x400 +CFLAGS= $(OPTIM) /W3 /WX /MD /nologo /Yd /Zi -D_WIN32_WINNT=0x400 LFLAGS= /INCREMENTAL:NO INCLUDES=-I. BUILD_DIR=.. @@ -96,8 +96,7 @@ PASSES= loadfree.pass \ priority1.pass priority2.pass inherit1.pass \ spin1.pass spin2.pass spin3.pass spin4.pass \ barrier1.pass barrier2.pass barrier3.pass barrier4.pass barrier5.pass \ - exception1.pass exception2.pass exception3.pass \ - exit4 + exception1.pass exception2.pass exception3.pass BENCHRESULTS = \ benchtest1.bench benchtest2.bench benchtest3.bench benchtest4.bench benchtest5.bench @@ -243,7 +242,6 @@ exception3.pass: exception2.pass exit1.pass: exit2.pass: create1.pass exit3.pass: create1.pass -exit4.pass: exit3.pass eyal1.pass: tsd1.pass inherit1.pass: join1.pass join0.pass: create1.pass diff --git a/tests/exit4.c b/tests/exit4.c deleted file mode 100644 index 480fc2e..0000000 --- a/tests/exit4.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Test for pthread_exit(). - * - * -------------------------------------------------------------------------- - * - * Pthreads-win32 - POSIX Threads Library for Win32 - * Copyright(C) 1998 John E. Bossom - * Copyright(C) 1999,2002 Pthreads-win32 contributors - * - * Contact Email: rpj@ise.canberra.edu.au - * - * The current list of contributors is contained - * in the file CONTRIBUTORS included with the source - * code distribution. The list can also be seen at the - * following World Wide Web location: - * http://sources.redhat.com/pthreads-win32/contributors.html - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library in the file COPYING.LIB; - * if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * -------------------------------------------------------------------------- - * - * Depends on API functions: pthread_create(). - */ - -#include "test.h" - -#ifdef __CLEANUP_CXX - -#define USE_PTHREAD_EXIT -static const int init_counter_value = 3; -static void *ret_value = reinterpret_cast(1); -static int counter = init_counter_value; - -class Guard -{ - const char * const _str; - int &_ref; - Guard &operator=(const Guard&); - Guard(const Guard&); -public: - Guard(const char * const str, int &ref) : _str(str), _ref(ref) { - printf("Construct %s [%d->%d]\n", _str, _ref, _ref+++1); - }; - ~Guard() { - printf("~Destruct %s [%d->%d]\n", _str, _ref, _ref---1); - }; -}; - - -void * -func(void * arg) -{ - Guard g("func", counter); - -#ifdef USE_PTHREAD_EXIT - - pthread_exit(arg); - assert(0); //Never reached with pthread_exit - -#endif //USE_PTHREAD_EXIT - - return ret_value; -} - - -#endif /*__CLEANUP_CXX */ - -int -main() -{ -#ifndef __CLEANUP_CXX - - printf("Test requires C++ cleanup enabled. Skipped.\n"); - -#else - - { - void *ret = 0; - Guard g("main", counter); - pthread_t id; - assert(0 == pthread_create(&id, 0, func, ret_value)); - assert(0 == pthread_join(id, &ret)); - assert(ret == ret_value); - } - - assert(counter == init_counter_value); - -#endif /*__CLEANUP_CXX */ - - return 0; -} -- cgit v1.2.3