summaryrefslogtreecommitdiff
path: root/implement.h
diff options
context:
space:
mode:
authorrpj <rpj>1999-08-12 00:53:52 +0000
committerrpj <rpj>1999-08-12 00:53:52 +0000
commitf92b4771baf8faccc197ae06922690d1cef74dad (patch)
tree8b06f29abbaf8d1cc027bab0731a9fe79db69413 /implement.h
parent77d0a6ff70ef2bb480c927e563340fc501ec0930 (diff)
1999-08-12 Ross Johnson <rpj@ixobrychus.canberra.edu.au>snap-1999-05-30-patches
* exit.c (pthread_exit): Check for implicitly created threads to avoid raising an unhandled exception. 1999-07-12 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * condvar.c (pthread_cond_destroy): Add critical section. (cond_timedwait): Add critical section; check for timeout waiting on semaphore. (pthread_cond_broadcast): Add critical section. - Peter Slacik <Peter.Slacik@tatramed.sk> 1999-07-09 Ross Johnson <rpj@ixobrychus.canberra.edu.au> The following changes fix a bug identified by Lorin Hochstein <lmh@xiphos.ca> and solved by John Bossom <John.Bossom@Cognos.COM>. The problem was that cleanup handlers were not executed when pthread_exit() was called. * implement.h (pthread_t_): Add exceptionInformation element for C++ per-thread exception information. (general): Define and rename exceptions. * misc.c (CancelableWait): _PTHREAD_EPS_CANCEL (SEH) and Pthread_exception_cancel (C++) used to identify the exception. * cancel.c (pthread_testcancel): _PTHREAD_EPS_CANCEL (SEH) and Pthread_exception_cancel (C++) used to identify the exception. * exit.c (pthread_exit): throw/raise an exception to return to _pthread_threadStart() to exit the thread. _PTHREAD_EPS_EXIT (SEH) and Pthread_exception_exit (C++) used to identify the exception. * private.c (_pthread_threadStart): Add pthread_exit exception trap; clean up and exit the thread directly rather than via pthread_exit().
Diffstat (limited to 'implement.h')
-rw-r--r--implement.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/implement.h b/implement.h
index a719167..f18c7d5 100644
--- a/implement.h
+++ b/implement.h
@@ -77,6 +77,9 @@ struct pthread_t_ {
sigset_t sigmask;
#endif /* HAVE_SIGSET_T */
int implicit:1;
+#ifdef __cplusplus
+ void * exceptionInformation;
+#endif
void *keys;
};
@@ -256,18 +259,27 @@ struct ThreadKeyAssoc {
*/
#define EXCEPTION_PTHREAD_SERVICES \
MAKE_SOFTWARE_EXCEPTION( SE_ERROR, \
- PTHREAD_SERVICES_FACILITY, \
- PTHREAD_SERVICES_ERROR )
+ _PTHREAD_SERVICES_FACILITY, \
+ _PTHREAD_SERVICES_ERROR )
+#define _PTHREAD_SERVICES_FACILITY 0xBAD
+#define _PTHREAD_SERVICES_ERROR 0xDEED
-#define PTHREAD_SERVICES_FACILITY 0xBAD
-#define PTHREAD_SERVICES_ERROR 0xDEED
+/*
+ * Services available through EXCEPTION_PTHREAD_SERVICES
+ */
+#define _PTHREAD_EPS_CANCEL 0
+#define _PTHREAD_EPS_EXIT 1
#else
#ifdef __cplusplus
-class Pthread_exception {};
+/*
+ * Exceptions similar to the SEH exceptions above.
+ */
+class Pthread_exception_cancel {};
+class Pthread_exception_exit {};
#else /* __cplusplus */