From 82fa43b768e09bf30669351b61eb2f94cb1c71a3 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 24 Jul 1998 07:52:30 +0000 Subject: Fri Jul 24 16:33:17 1998 Ross Johnson * sync.c (pthread_detach): Use equality test, not assignment. * create.c (_pthread_start_call): Add call to Win32 CloseHandle() if thread is detached. --- ChangeLog | 7 +++++++ create.c | 5 +++++ sync.c | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4ad0356..eb072c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Jul 24 16:33:17 1998 Ross Johnson + + * sync.c (pthread_detach): Use equality test, not assignment. + + * create.c (_pthread_start_call): Add call to Win32 CloseHandle() + if thread is detached. + 1998-07-24 Ben Elliston * sync.c (pthread_detach): Close the Win32 thread handle to diff --git a/create.c b/create.c index e15a98f..45b1570 100644 --- a/create.c +++ b/create.c @@ -24,6 +24,11 @@ _pthread_start_call(void * thisarg) unsigned ret; int from; + if (this->detached == PTHREAD_CREATE_DETACHED) + { + (void) CloseHandle(this->thread); + } + func = this->call.routine; arg = this->call.arg; diff --git a/sync.c b/sync.c index 2fc08ec..c4e4327 100644 --- a/sync.c +++ b/sync.c @@ -73,7 +73,7 @@ pthread_detach(pthread_t thread) this = _pthread_find_thread_entry(thread); - if (this = -1) + if (this == -1) { return ESRCH; } -- cgit v1.2.3