From: cristianrosa Date: Tue, 18 Aug 2009 09:24:56 +0000 (+0000) Subject: Fix bug related to the exception mechanism once the context module exits X-Git-Tag: SVN~1082 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b8725d9c7b165dfe0b689ded7ed39d95cda7f5ab Fix bug related to the exception mechanism once the context module exits git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6589 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/simix/smx_context_java.c b/src/simix/smx_context_java.c index c304b9ca15..47af4c483d 100644 --- a/src/simix/smx_context_java.c +++ b/src/simix/smx_context_java.c @@ -74,10 +74,13 @@ void SIMIX_ctx_java_factory_init(smx_context_factory_t * factory) static int smx_ctx_java_factory_finalize(smx_context_factory_t * factory) { - /*FIXME: free(maestro_context->exception);*/ free(*factory); *factory = NULL; + /* Restore the default exception setup */ + __xbt_ex_ctx = &__xbt_ex_ctx_default; + __xbt_ex_terminate = &__xbt_ex_terminate_default; + return 0; } diff --git a/src/simix/smx_context_sysv.c b/src/simix/smx_context_sysv.c index f0bd8aa463..3baf8f2f8a 100644 --- a/src/simix/smx_context_sysv.c +++ b/src/simix/smx_context_sysv.c @@ -92,9 +92,13 @@ void SIMIX_ctx_sysv_factory_init(smx_context_factory_t *factory) static int smx_ctx_sysv_factory_finalize(smx_context_factory_t * factory) { - /*FIXME free(maestro_context->exception);*/ free(*factory); *factory = NULL; + + /* Restore the default exception setup */ + __xbt_ex_ctx = &__xbt_ex_ctx_default; + __xbt_ex_terminate = &__xbt_ex_terminate_default; + return 0; } diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index f827c4a52e..cb7a98e8cf 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -118,6 +118,10 @@ void xbt_os_thread_mod_exit(void) #ifndef HAVE_SEM_WAIT xbt_os_mutex_destroy(next_sem_ID_lock); #endif + + /* Restore the default exception setup */ + __xbt_ex_ctx = &__xbt_ex_ctx_default; + __xbt_ex_terminate = &__xbt_ex_terminate_default; } static void *wrapper_start_routine(void *s)