diff options
author | rpj <rpj> | 1999-11-04 14:56:51 +0000 |
---|---|---|
committer | rpj <rpj> | 1999-11-04 14:56:51 +0000 |
commit | c614567b4940f31a7ce98ceb9eb48b1241b4727a (patch) | |
tree | aaa362d4c46c13f7fb7546b1ee14264e32b22ec1 /misc.c | |
parent | efa438832bc1343c08c334e88aec4266040ddec3 (diff) |
Add WinCE patches to snap-1999-05-30-wince-patches branch.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -163,6 +163,10 @@ pthread_self (void) self->thread = GetCurrentThreadId (); +#ifdef UNDER_CE + /* DuplicateHandle does not exist on WinCE */ + self->threadH = GetCurrentThread(); +#else if( !DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), @@ -175,6 +179,7 @@ pthread_self (void) free( self ); return (NULL); } +#endif } pthread_setspecific (_pthread_selfThreadKey, self); @@ -314,7 +319,7 @@ CancelableWait (HANDLE waitHandle, DWORD timeout) DWORD exceptionInformation[3]; - exceptionInformation[0] = (DWORD) (_PTHREAD_EPS_CANCEL); + exceptionInformation[0] = (DWORD) (0); exceptionInformation[1] = (DWORD) (0); exceptionInformation[2] = (DWORD) (0); @@ -328,7 +333,7 @@ CancelableWait (HANDLE waitHandle, DWORD timeout) #ifdef __cplusplus - throw Pthread_exception_cancel(); + throw Pthread_exception(); #endif /* __cplusplus */ @@ -361,4 +366,17 @@ pthreadCancelableTimedWait (HANDLE waitHandle, DWORD timeout) return (CancelableWait(waitHandle, timeout)); } - +#ifdef NEED_CALLOC +void +*_pthread_calloc(size_t n, size_t s) { + unsigned int m = n*s; + void *p; + + p = malloc(m); + if (p == NULL) return NULL; + + memset(p, 0, m); + + return p; +} +#endif |