summaryrefslogtreecommitdiff
path: root/private.c
diff options
context:
space:
mode:
authorrpj <rpj>2001-06-19 04:49:08 +0000
committerrpj <rpj>2001-06-19 04:49:08 +0000
commit528fccade9ca5f90db376e08b2cb85b3fc822a45 (patch)
tree7ac86892c4b735b5308a5f8467926258f7a48989 /private.c
parent5561998d3f57b23914c5a8cc5a07e53492242a3e (diff)
* 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 <dgk@research.att.com> * 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.
Diffstat (limited to 'private.c')
-rw-r--r--private.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/private.c b/private.c
index ecae84a..a9953c9 100644
--- a/private.c
+++ b/private.c
@@ -24,7 +24,9 @@
* MA 02111-1307, USA
*/
-#include <process.h>
+#ifndef _UWIN
+# include <process.h>
+#endif
#ifndef NEED_FTIME
#include <sys/timeb.h>
#endif
@@ -278,6 +280,11 @@ ptw32_threadStart (void * vthreadParms)
* Run the caller's routine;
*/
status = self->exitStatus = (*start) (arg);
+#ifdef _UWIN
+ if (--pthread_count <= 0)
+ exit(0);
+#endif
+
}
__except (ExceptionFilter(GetExceptionInformation(), ei))
{
@@ -285,6 +292,10 @@ ptw32_threadStart (void * vthreadParms)
{
case PTW32_EPS_CANCEL:
status = PTHREAD_CANCELED;
+#ifdef _UWIN
+ if (--pthread_count <= 0)
+ exit(0);
+#endif
break;
case PTW32_EPS_EXIT:
status = self->exitStatus;