Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Forgot to update migrate signature in Process
[simgrid.git] / src / smx_context_java.c
index aa2d0c2..b2abae8 100644 (file)
@@ -8,7 +8,7 @@
 
 
 #include <xbt/function_types.h>
-#include <simix/simix.h>
+#include <simgrid/simix.h>
 #include "smx_context_java.h"
 #include "xbt/dynar.h"
 
@@ -16,7 +16,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jmsg, bindings, "MSG for Java(TM)");
 
 static smx_context_t my_current_context = NULL;
 
-static smx_context_t smx_ctx_java_self(void);
 static smx_context_t
 smx_ctx_java_factory_create_context(xbt_main_func_t code, int argc,
                                     char **argv,
@@ -46,7 +45,7 @@ void SIMIX_ctx_java_factory_init(smx_context_factory_t * factory)
   (*factory)->get_data = smx_ctx_base_get_data;
 }
 
-static smx_context_t smx_ctx_java_self(void)
+smx_context_t smx_ctx_java_self(void)
 {
        return my_current_context;
 }
@@ -68,7 +67,8 @@ smx_ctx_java_factory_create_context(xbt_main_func_t code, int argc,
     context->jenv = get_current_thread_env();
     jprocess_start(((smx_ctx_java_t) context)->jprocess,
                    get_current_thread_env());
-  }else{
+  }
+  else {
     my_current_context = (smx_context_t)context;
   }
   context->super.data = data;
@@ -97,11 +97,13 @@ static void smx_ctx_java_free(smx_context_t context)
   smx_ctx_base_free(context);
 }
 
+
 void smx_ctx_java_stop(smx_context_t context)
 {
 xbt_assert(context == my_current_context,
-      "The context to stop must be the current one");
+ xbt_assert(context == my_current_context,
+     "The context to stop must be the current one");
   /* I am the current process and I am dying */
+  
   smx_ctx_base_stop(context);
 
   XBT_DEBUG("I am dying");
@@ -109,7 +111,7 @@ void smx_ctx_java_stop(smx_context_t context)
   /* suspend myself again, smx_ctx_java_free() will destroy me later
    * from maeastro */
   jprocess_unschedule(context);
-  xbt_die("This function was not supposed to return");
+  XBT_DEBUG("Java stop finished");
 }
 
 static void smx_ctx_java_suspend(smx_context_t context)