diff options
author | rpj <rpj> | 1999-03-23 19:43:43 +0000 |
---|---|---|
committer | rpj <rpj> | 1999-03-23 19:43:43 +0000 |
commit | ab9f05fd540b3eff6456f886edda87cb95bfbadc (patch) | |
tree | cce54aa13890262b6c6c8357f64479aedd902752 /misc.c | |
parent | aa07e974e0a6277492cc091762751ec28dfe3e96 (diff) |
Wed Mar 24 11:32:07 1999 Ross Johnson <rpj@swan.canberra.edu.au>
* misc.c (CancelableWait): Initialise exceptionInformation[2].
(pthread_self): Get a real Win32 thread handle for implicit threads.
* cancel.c (pthread_testcancel): Initialise exceptionInformation[2].
* implement.h (SE_INFORMATION): Fix values.
* private.c (_pthread_threadDestroy): Close the thread handle.
Fri Mar 19 12:57:27 1999 Ross Johnson <rpj@swan.canberra.edu.au>
* cancel.c (comments): Update and cleanup.
Fri Mar 19 09:12:59 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* private.c (_pthread_threadStart): status returns PTHREAD_CANCELED.
* pthread.h (PTHREAD_CANCELED): defined.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -26,9 +26,6 @@ #include "pthread.h" #include "implement.h" -/* - * Code contributed by John E. Bossom <JEB>. - */ int pthread_once ( @@ -158,14 +155,26 @@ pthread_self (void) * executing thread. */ self = (pthread_t) calloc (1, sizeof (*self)); + if (self != NULL) { - self->implicit = 1; self->detachState = PTHREAD_CREATE_DETACHED; self->thread = GetCurrentThreadId (); - self->threadH = GetCurrentThread (); + + if( !DuplicateHandle( + GetCurrentProcess(), + GetCurrentThread(), + GetCurrentProcess(), + &self->threadH, + 0, + FALSE, + DUPLICATE_SAME_ACCESS ) ) + { + free( self ); + return (NULL); + } } pthread_setspecific (_pthread_selfThreadKey, self); @@ -307,6 +316,7 @@ CancelableWait (HANDLE waitHandle, DWORD timeout) exceptionInformation[0] = (DWORD) (0); exceptionInformation[1] = (DWORD) (0); + exceptionInformation[2] = (DWORD) (0); RaiseException ( EXCEPTION_PTHREAD_SERVICES, @@ -351,5 +361,4 @@ pthreadCancelableTimedWait (HANDLE waitHandle, DWORD timeout) return (CancelableWait(waitHandle, timeout)); } -/* </JEB> */ |