summaryrefslogtreecommitdiff
path: root/private.c
diff options
context:
space:
mode:
authorrpj <rpj>1999-01-12 14:48:53 +0000
committerrpj <rpj>1999-01-12 14:48:53 +0000
commitbc374000d4dda28009ceb1f03a5514687be8904c (patch)
treeed0423713c55ec8c5fcd7ea801edbda62bef6ab7 /private.c
parent66f7d3aafbde9b4f628dcdc23c7f59b28d86760b (diff)
Wed Jan 13 09:34:52 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* build.bat: Delete old binaries before compiling/linking. Tue Jan 12 09:58:38 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * dll.c: The Microsoft compiler pragmas probably are more appropriately protected by _MSC_VER than by _WIN32. - Tor Lillqvist <tml@iki.fi>. * condvar.c (pthread_cond_timedwait): Fix function description comments. * pthread.h: Define ETIMEDOUT. This should be returned by pthread_cond_timedwait which is not implemented yet as of snapshot-1999-01-04-1305. It was implemented in the older version. The Microsoft compiler pragmas probably are more appropriately protected by _MSC_VER than by _WIN32. - Tor Lillqvist <tml@iki.fi>. * pthread.def: pthread_mutex_destroy was missing from the def file - Tor Lillqvist <tml@iki.fi>. * condvar.c (pthread_cond_broadcast): Ensure we only wait on threads if there were any waiting on the condition. I think pthread_cond_broadcast should do the WaitForSingleObject only if cv->waiters > 0? Otherwise it seems to hang, at least in the testg thread program from glib. - Tor Lillqvist <tml@iki.fi>. * semaphore.c (sem_post): Correct typo in comment. Mon Jan 11 20:33:19 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * pthread.h: Re-arrange conditional compile of pthread_cleanup-* macros. * cleanup.c (_pthread_push_cleanup): Provide conditional compile of cleanup->prev.
Diffstat (limited to 'private.c')
-rw-r--r--private.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/private.c b/private.c
index 4ae12e8..d7b44c9 100644
--- a/private.c
+++ b/private.c
@@ -121,6 +121,8 @@ _pthread_threadStart (ThreadParms * threadParms)
pthread_setspecific (_pthread_selfThreadKey, tid);
+#ifdef _WIN32
+
__try
{
/*
@@ -138,6 +140,41 @@ _pthread_threadStart (ThreadParms * threadParms)
status = -1;
}
+#else /* _WIN32 */
+
+#ifdef __cplusplus
+
+ try
+ {
+ /*
+ * Run the caller's routine;
+ */
+ (*start) (arg);
+ status = 0;
+ }
+ catch (...)
+ {
+ /*
+ * A system unexpected exception had occurred running the user's
+ * routine. We get control back within this block.
+ */
+ status = -1;
+ }
+
+#else /* __cplusplus */
+
+#error Warning: Compile __FILE__ as C++ or thread cancellation will not work.
+
+ /*
+ * Run the caller's routine;
+ */
+ (*start) (arg);
+ status = 0;
+
+#endif /* __cplusplus */
+
+#endif /* _WIN32 */
+
pthread_exit ((void *) status);
return ((void *) status);