summaryrefslogtreecommitdiff
path: root/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'exit.c')
-rw-r--r--exit.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/exit.c b/exit.c
index 18592a2..32468d9 100644
--- a/exit.c
+++ b/exit.c
@@ -61,12 +61,17 @@ pthread_exit (void *value_ptr)
*/
self = (pthread_t) pthread_getspecific (_pthread_selfThreadKey);
+ self->exitStatus = value_ptr;
if (self == NULL || self->implicit)
{
_pthread_callUserDestroyRoutines(self);
+#if ! defined (__MINGW32__) || defined (__MSVCRT__)
_endthreadex ((unsigned) value_ptr);
+#else
+ _endthread ();
+#endif
/* Never reached */
}
@@ -90,7 +95,6 @@ pthread_exit (void *value_ptr)
#ifdef __cplusplus
- self->exceptionInformation = value_ptr;
throw Pthread_exception_exit();
#else /* ! __cplusplus */
@@ -99,7 +103,11 @@ pthread_exit (void *value_ptr)
_pthread_callUserDestroyRoutines(self);
+#if ! defined (__MINGW32__) || defined (__MSVCRT__)
_endthreadex ((unsigned) value_ptr);
+#else
+ _endthread ();
+#endif
#endif /* __cplusplus */