From 528fccade9ca5f90db376e08b2cb85b3fc822a45 Mon Sep 17 00:00:00 2001 From: rpj Date: Tue, 19 Jun 2001 04:49:08 +0000 Subject: * Made organisational-only changes to UWIN additions. * dll.c (dllMain): Moved UWIN process attach code to pthread_win32_process_attach_np(); moved instance of pthread_count to global.c. * global.c (pthread_count): Moved from dll.c. * nonportable.c (pthread_win32_process_attach_np): Moved _UWIN code to here from dll.c. * implement.h (pthread_count): Define extern int. * create.c (pthread_count): Remove extern int. * private.c (pthread_count): Likewise. * exit.c (pthread_count): Likewise. Contributed by - David Korn * dll.c: Added changes necessary to work with UWIN. * create.c: Likewise. * pthread.h: Likewise. * misc.c: Likewise. * exit.c: Likewise. * private.c: Likewise. * implement.h: Likewise. There is some room at the start of struct pthread_t_ to implement the signal semantics in UWIN's posix.dll although this is not yet complete. * Nmakefile: Compatible with UWIN's Nmake utility. * Nmakefile.tests: Likewise - for running the tests. --- implement.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'implement.h') diff --git a/implement.h b/implement.h index 0df0e4c..da094c8 100644 --- a/implement.h +++ b/implement.h @@ -71,6 +71,9 @@ typedef enum { PThreadDemise; struct pthread_t_ { +#ifdef _UWIN + DWORD dummy[5]; +#endif DWORD thread; HANDLE threadH; PThreadState state; @@ -331,6 +334,9 @@ extern CRITICAL_SECTION ptw32_mutex_test_init_lock; extern CRITICAL_SECTION ptw32_cond_test_init_lock; extern CRITICAL_SECTION ptw32_rwlock_test_init_lock; +#ifdef _UWIN +extern int pthread_count; +#endif /* Declared in misc.c */ #ifdef NEED_CALLOC @@ -391,6 +397,25 @@ BOOL ptw32_increase_semaphore(sem_t * sem, #endif /* __cplusplus */ +#ifdef _UWIN_ +# ifdef _MT +# ifdef __cplusplus + extern "C" { +# endif + _CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *), + unsigned, void *); + _CRTIMP void __cdecl _endthread(void); + _CRTIMP unsigned long __cdecl _beginthreadex(void *, unsigned, + unsigned (__stdcall *) (void *), void *, unsigned, unsigned *); + _CRTIMP void __cdecl _endthreadex(unsigned); +# ifdef __cplusplus + } +# endif +# endif +#else +# include +#endif + /* * Check for old and new versions of cygwin. See the FAQ file: * -- cgit v1.2.3