summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--exit.c42
-rw-r--r--private.c6
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/runall.bat1
5 files changed, 40 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e03c53..b9dc259 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+1999-08-22 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
+
+ * exit.c (pthread_exit): Fix reference to potentially
+ uninitialised pointer.
+
+1999-08-21 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
+
+ * private.c (_pthread_threadStart): Apply fix of 1999-08-19
+ this time to C++ and non-trapped C versions. Ommitted to
+ do this the first time through.
+
1999-08-19 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* private.c (_pthread_threadStart): Return exit status from
diff --git a/exit.c b/exit.c
index 32468d9..ff0aab3 100644
--- a/exit.c
+++ b/exit.c
@@ -53,6 +53,12 @@ pthread_exit (void *value_ptr)
{
pthread_t self;
+#ifdef _MSC_VER
+
+ DWORD exceptionInformation[3];
+
+#endif
+
/* If the current thread is implicit it was not started through
pthread_create(), therefore we cleanup and end the thread
here. Otherwise we raise an exception to unwind the exception
@@ -61,7 +67,6 @@ pthread_exit (void *value_ptr)
*/
self = (pthread_t) pthread_getspecific (_pthread_selfThreadKey);
- self->exitStatus = value_ptr;
if (self == NULL || self->implicit)
{
@@ -75,46 +80,43 @@ pthread_exit (void *value_ptr)
/* Never reached */
}
- else
- {
+
+ self->exitStatus = value_ptr;
+
#ifdef _MSC_VER
-
- DWORD exceptionInformation[3];
- exceptionInformation[0] = (DWORD) (_PTHREAD_EPS_EXIT);
- exceptionInformation[1] = (DWORD) (value_ptr);
- exceptionInformation[2] = (DWORD) (0);
+ exceptionInformation[0] = (DWORD) (_PTHREAD_EPS_EXIT);
+ exceptionInformation[1] = (DWORD) (value_ptr);
+ exceptionInformation[2] = (DWORD) (0);
- RaiseException (
- EXCEPTION_PTHREAD_SERVICES,
- 0,
- 3,
- exceptionInformation);
+ RaiseException (
+ EXCEPTION_PTHREAD_SERVICES,
+ 0,
+ 3,
+ exceptionInformation);
#else /* ! _MSC_VER */
#ifdef __cplusplus
- throw Pthread_exception_exit();
+ throw Pthread_exception_exit();
#else /* ! __cplusplus */
- (void) pthread_pop_cleanup( 1 );
+ (void) pthread_pop_cleanup( 1 );
- _pthread_callUserDestroyRoutines(self);
+ _pthread_callUserDestroyRoutines(self);
#if ! defined (__MINGW32__) || defined (__MSVCRT__)
- _endthreadex ((unsigned) value_ptr);
+ _endthreadex ((unsigned) value_ptr);
#else
- _endthread ();
+ _endthread ();
#endif
#endif /* __cplusplus */
#endif /* _MSC_VER */
- }
-
/* Never reached. */
}
diff --git a/private.c b/private.c
index 58bf148..ede6b14 100644
--- a/private.c
+++ b/private.c
@@ -237,8 +237,7 @@ _pthread_threadStart (ThreadParms * threadParms)
/*
* Run the caller's routine;
*/
- (*start) (arg);
- status = self->exitStatus = (void *) 0;
+ status = self->exitStatus = (*start) (arg);
}
catch (Pthread_exception_cancel)
{
@@ -269,8 +268,7 @@ _pthread_threadStart (ThreadParms * threadParms)
* Run the caller's routine; no cancelation or other exceptions will
* be honoured.
*/
- (*start) (arg);
- status = (void *) 0;
+ status = (*start) (arg);
#endif /* __cplusplus */
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 3d5163b..1ee3634 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+Aug 22 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
+
+ * runall.bat (join2): Add test.
+
Aug 19 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* join2.c: New test.
diff --git a/tests/runall.bat b/tests/runall.bat
index 0e3801b..8086fc3 100644
--- a/tests/runall.bat
+++ b/tests/runall.bat
@@ -14,6 +14,7 @@ call runtest cl equal1
call runtest cl exit2
call runtest cl exit3
call runtest cl join1
+call runtest cl join2
call runtest cl count1
call runtest cl once1
call runtest cl tsd1