summaryrefslogtreecommitdiff
path: root/create.c
diff options
context:
space:
mode:
authorrpj <rpj>2000-07-25 11:27:23 +0000
committerrpj <rpj>2000-07-25 11:27:23 +0000
commitb035ed05977fdef5ced4691028284b7f0ebaba19 (patch)
tree008e3d049ac5a01cd34118ddb2f219d7040845b8 /create.c
parent20aff4de1de1ed8c89c5b617e4eae4f475bb4a6e (diff)
2000-07-25 Ross Johnson <rpj@setup1.ise.canberra.edu.au>
* dll.c (dllMain): Remove 2000-07-21 change - problem appears to be in pthread_create(). 2000-07-21 Ross Johnson <rpj@setup1.ise.canberra.edu.au> * create.c (pthread_create): Set threadH to 0 (zero) everywhere. Some assignments were using NULL. Maybe it should be NULL everywhere - need to check. (I know they are nearly always the same thing - but not by definition.) * dll.c: Include resource leakage work-around. This is a partial FIXME which doesn't stop all leakage. The real problem needs to be found and fixed. - "David Baggett" <dmb@itasoftware.com> * misc.c (pthread_self): Try to catch NULL thread handles at the point where they might be generated, even though they should always be valid at this point. * tsd.c (pthread_setspecific): return an error value if pthread_self() returns NULL. * sync.c (pthread_join): return an error value if pthread_self() returns NULL. * signal.c (pthread_sigmask): return an error value if pthread_self() returns NULL.
Diffstat (limited to 'create.c')
-rw-r--r--create.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/create.c b/create.c
index 79085bf..ac1384f 100644
--- a/create.c
+++ b/create.c
@@ -125,6 +125,7 @@ pthread_create (pthread_t * tid,
: PThreadStateSuspended;
thread->keys = NULL;
+
#if ! defined (__MINGW32__) || defined (__MSVCRT__)
thread->threadH = (HANDLE)
@@ -144,14 +145,20 @@ pthread_create (pthread_t * tid,
(unsigned) stackSize, /* default stack size */
parms);
- /* Make the return code to match _beginthreadex's. */
+ /*
+ * Make the return code match _beginthreadex's.
+ */
if (thread->threadH == (HANDLE)-1L)
- thread->threadH = NULL;
+ {
+ thread->threadH = 0;
+ }
else if (! run)
{
- /* beginthread does not allow for create flags, so we do it now.
- Note that beginthread itself creates the thread in SUSPENDED
- mode, and then calls ResumeThread to start it. */
+ /*
+ * beginthread does not allow for create flags, so we do it now.
+ * Note that beginthread itself creates the thread in SUSPENDED
+ * mode, and then calls ResumeThread to start it.
+ */
SuspendThread (thread->threadH);
}