summaryrefslogtreecommitdiff
path: root/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'exit.c')
-rw-r--r--exit.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/exit.c b/exit.c
index a9c352c..1e07ccd 100644
--- a/exit.c
+++ b/exit.c
@@ -36,6 +36,17 @@ _pthread_vacuum(void)
void
pthread_exit(void * value)
{
- _pthread_vacuum();
- _endthreadex((DWORD) value);
+ _pthread_threads_thread_t * this;
+
+ this = _PTHREAD_THIS;
+
+ if (this->joinvalueptr != NULL)
+ {
+ *(this->joinvalueptr) = value;
+ }
+
+ /* FIXME: More to do here. IE, if pthread_detach() was called
+ and value != NULL, do we free(value)? */
+
+ longjmp(this->call.env, 1);
}