summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--FAQ14
-rw-r--r--GNUmakefile5
-rw-r--r--tests/ChangeLog30
-rw-r--r--tests/Makefile2
-rw-r--r--tests/condvar2.c2
-rw-r--r--tests/condvar2_1.c2
-rw-r--r--tests/condvar3_1.c2
-rw-r--r--tests/condvar3_2.c2
-rw-r--r--tests/context1.c2
-rw-r--r--tests/priority1.c8
-rw-r--r--tests/sizes.c2
-rw-r--r--tests/test.h1
13 files changed, 55 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 16b96b0..1623c31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-19 Ross Johnson <rpj@callisto.canberra.edu.au>
+
+ * Makefile: Don't define _WIN32_WINNT on compiler command line.
+ * GNUmakefile: Likewise.
+
2004-05-16 Ross Johnson <rpj@callisto.canberra.edu.au>
* pthread_cancel.c (pthread_cancel): Adapted to use auto-detected
diff --git a/FAQ b/FAQ
index 34ef8b8..c9ffe10 100644
--- a/FAQ
+++ b/FAQ
@@ -345,8 +345,11 @@ been able to get to it.
If the thread you're trying to cancel is blocked (for instance, it could be
waiting for data from the network), it will only get cancelled when it unblocks
-(when the data arrives). Unfortunately, there is no way to do so from
-outside the thread.
+(when the data arrives). For true pre-emptive cancelation in these cases,
+pthreads-win32 from snapshot 2004-05-16 can automatically recognise and use the
+QueueUserAPCEx package by Panagiotis E. Hadjidoukas. This package is available
+from the pthreads-win32 ftp site and is included in the pthreads-win32
+self-unpacking zip from 2004-05-16 onwards.
Using deferred cancelation would normally be the way to go, however,
even though the POSIX threads standard lists a number of C library
@@ -385,10 +388,9 @@ Ross
Q 10 How do I create thread-safe applications using
---- pthreadGCE.dll, libpthreadw32.a and Mingw32?
-See Thomas Pfaff's email at:
-http://sources.redhat.com/ml/pthreads-win32/2002/msg00000.html
-
-Later versions should thread-safe.
+This should not be a problem with recent versions of MinGW32.
+For early versions, see Thomas Pfaff's email at:
+http://sources.redhat.com/ml/pthreads-win32/2002/msg00000.html
------------------------------------------------------------------------------
diff --git a/GNUmakefile b/GNUmakefile
index f4ef715..b07420f 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -57,10 +57,7 @@ GCE_CFLAGS = -D__CLEANUP_CXX -mthreads
## Mingw32
MAKE = make
-CFLAGS = $(OPT) -I. -D_WIN32_WINNT=0x400 -DHAVE_CONFIG_H -Wall
-
-## Cygwin G++
-#CFLAGS = $(OPT) -x $(GLANG) -fhandle-exceptions -D_WIN32_WINNT=0x400 -I. -DHAVE_CONFIG_H -Wall
+CFLAGS = $(OPT) -I. -DHAVE_CONFIG_H -Wall
DLL_INLINED_OBJS = \
pthread.o
diff --git a/tests/ChangeLog b/tests/ChangeLog
index e62c257..7213eb4 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,16 +1,30 @@
2004-05-16 Ross Johnson <rpj@callisto.canberra.edu.au>
- * cancel9.c: New test.
- * cancel3.c: Remove inappropriate conditional compilation;
- GNU C version of test suite no longer quietly skips this test.
- * cancel5.c: Likewise.
- * GNUmakefile: Can now build individual test app using default
- C version of library using 'make clean testname.c'.
- * Makefile: Likewise for VC using 'nmake clean test testname.c'.
+ * condvar2.c (WIN32_WINNT): Define to avoid redefinition warning
+ from inclusion of implement.h.
+ * convar2_1.c: Likewise.
+ * condvar3_1.c: Likewise.
+ * condvar3_2.c: Likewise.
+ * context1.c: Likewise.
+ * sizes.c: Likewise.
+ * Makefile: Don't define _WIN32_WINNT on compiler command line.
+ * GNUmakefile: Likewise.
+ * priority1.c (main): Add column to output for actual win32
+ priority.
+
+2004-05-16 Ross Johnson <rpj@callisto.canberra.edu.au>
+
+ * cancel9.c: New test.
+ * cancel3.c: Remove inappropriate conditional compilation;
+ GNU C version of test suite no longer quietly skips this test.
+ * cancel5.c: Likewise.
+ * GNUmakefile: Can now build individual test app using default
+ C version of library using 'make clean testname.c'.
+ * Makefile: Likewise for VC using 'nmake clean test testname.c'.
2003-10-14 Ross Johnson <rpj@callisto.canberra.edu.au>
- * Wmakefile: New makefile for Watcom testing.
+ * Wmakefile: New makefile for Watcom testing.
2003-09-18 Ross Johnson <rpj@callisto.canberra.edu.au>
diff --git a/tests/Makefile b/tests/Makefile
index 17cb0c8..1a7d81c 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -66,7 +66,7 @@ VCXFLAGS = /GX /TP /D__CLEANUP_C
CPLIB = pthreadVC.lib
CPDLL = pthreadVC.dll
-CFLAGS= $(OPTIM) /W3 /WX /MD /nologo /Yd /Zi -D_WIN32_WINNT=0x400
+CFLAGS= $(OPTIM) /W3 /WX /MD /nologo /Yd /Zi
LFLAGS= /INCREMENTAL:NO
INCLUDES=-I.
BUILD_DIR=..
diff --git a/tests/condvar2.c b/tests/condvar2.c
index 982bd7f..7946cea 100644
--- a/tests/condvar2.c
+++ b/tests/condvar2.c
@@ -73,6 +73,8 @@
* - Process returns non-zero exit status.
*/
+#define _WIN32_WINNT 0x400
+
#include "test.h"
#include <sys/timeb.h>
diff --git a/tests/condvar2_1.c b/tests/condvar2_1.c
index 7a61fdf..e849ff1 100644
--- a/tests/condvar2_1.c
+++ b/tests/condvar2_1.c
@@ -73,6 +73,8 @@
* - Process returns non-zero exit status.
*/
+#define _WIN32_WINNT 0x400
+
#include "test.h"
#include <sys/timeb.h>
diff --git a/tests/condvar3_1.c b/tests/condvar3_1.c
index 59ba596..200aaf9 100644
--- a/tests/condvar3_1.c
+++ b/tests/condvar3_1.c
@@ -75,6 +75,8 @@
* - Process returns non-zero exit status.
*/
+#define _WIN32_WINNT 0x400
+
#include "test.h"
#include <sys/timeb.h>
diff --git a/tests/condvar3_2.c b/tests/condvar3_2.c
index a5cb848..865ca9d 100644
--- a/tests/condvar3_2.c
+++ b/tests/condvar3_2.c
@@ -75,6 +75,8 @@
* - Process returns non-zero exit status.
*/
+#define _WIN32_WINNT 0x400
+
#include "test.h"
#include <sys/timeb.h>
diff --git a/tests/context1.c b/tests/context1.c
index 29005dc..405f9da 100644
--- a/tests/context1.c
+++ b/tests/context1.c
@@ -71,6 +71,8 @@
* - Process returns non-zero exit status.
*/
+#define _WIN32_WINNT 0x400
+
#include "test.h"
#include "../implement.h"
diff --git a/tests/priority1.c b/tests/priority1.c
index 1dc6ea7..c68e506 100644
--- a/tests/priority1.c
+++ b/tests/priority1.c
@@ -148,22 +148,24 @@ main()
PTW32TEST_THREAD_INIT_PRIO);
printf("Using pthread_getschedparam\n");
- printf("%10s %10s\n", "Set value", "Get value");
+ printf("%10s %10s %10s\n", "Set value", "Get value", "Win priority");
for (param.sched_priority = minPrio;
param.sched_priority <= maxPrio;
param.sched_priority++)
{
+ int prio;
+
assert(pthread_attr_setschedparam(&attr, &param) == 0);
assert(pthread_create(&t, &attr, func, (void *) &attr) == 0);
- assert(GetThreadPriority(pthread_getw32threadhandle_np(t))
+ assert((prio = GetThreadPriority(pthread_getw32threadhandle_np(t)))
== validPriorities[param.sched_priority+(PTW32TEST_MAXPRIORITIES/2)]);
assert(pthread_join(t, &result) == 0);
assert(param.sched_priority == (int) result);
- printf("%10d %10d\n", param.sched_priority, (int) result);
+ printf("%10d %10d %10d\n", param.sched_priority, (int) result, prio);
}
return 0;
diff --git a/tests/sizes.c b/tests/sizes.c
index 709c610..da7e115 100644
--- a/tests/sizes.c
+++ b/tests/sizes.c
@@ -1,3 +1,5 @@
+#define _WIN32_WINNT 0x400
+
#include "test.h"
#include "../implement.h"
diff --git a/tests/test.h b/tests/test.h
index 203e332..072b797 100644
--- a/tests/test.h
+++ b/tests/test.h
@@ -41,6 +41,7 @@
#include "pthread.h"
#include "sched.h"
#include "semaphore.h"
+
#include <windows.h>
#include <stdio.h>