diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | cleanup.c | 65 | ||||
-rw-r--r-- | private.c | 2 |
3 files changed, 52 insertions, 23 deletions
@@ -1,3 +1,11 @@ +Tue Jan 5 16:33:04 1999 Ross Johnson <rpj@swan.canberra.edu.au> + + * cleanup.c (_pthread_pop_cleanup): Add C++ version of __try/__except + block. Move trailing "}" out of #ifdef _WIN32 block left there by + (rpj's) mistake. + + * private.c: Remove #include <errno.h> which is included by pthread.h. + 1998-12-11 Ben Elliston <bje@toilet.to.cygnus.com> * README: Update info about subscribing to the mailing list. @@ -54,31 +54,54 @@ _pthread_pop_cleanup (int execute) #ifdef _WIN32 __try - { - /* - * Run the caller's cleanup routine. - */ - (*cleanup->routine) (cleanup->arg); - } + { + /* + * Run the caller's cleanup routine. + */ + (*cleanup->routine) (cleanup->arg); + } __except (EXCEPTION_EXECUTE_HANDLER) - { - /* - * A system unexpected exception had occurred - * running the user's cleanup routine. - * We get control back within this block. - */ - } - } - -#else - - /* - * Run the caller's cleanup routine. - */ - (*cleanup->routine) (cleanup->arg); + { + /* + * A system unexpected exception had occurred + * running the user's cleanup routine. + * We get control back within this block. + */ + } + +#else /* _WIN32 */ + +#ifdef _cplusplus + + try + { + /* + * Run the caller's cleanup routine. + */ + (*cleanup->routine) (cleanup->arg); + } + catch(...) + { + /* + * A system unexpected exception had occurred + * running the user's cleanup routine. + * We get control back within this block. + */ + } + +#else /* _cplusplus */ + + /* + * Run the caller's cleanup routine and FIXME: hope for the best. + */ + (*cleanup->routine) (cleanup->arg); + +#endif /* _cplusplus */ #endif /* _WIN32 */ + } + pthread_setspecific (_pthread_cleanupKey, cleanup->prev); } @@ -6,8 +6,6 @@ * the implementation and may be used throughout it. */ -#include <errno.h> - #include "pthread.h" #include "implement.h" |