Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix bug related to the exception mechanism once the context module exits
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Aug 2009 09:24:56 +0000 (09:24 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Aug 2009 09:24:56 +0000 (09:24 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6589 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simix/smx_context_java.c
src/simix/smx_context_sysv.c
src/xbt/xbt_os_thread.c

index c304b9c..47af4c4 100644 (file)
@@ -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;
 }
 
index f0bd8aa..3baf8f2 100644 (file)
@@ -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;
 }
 
index f827c4a..cb7a98e 100644 (file)
@@ -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)