Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't need private files without this command line
[simgrid.git] / src / smx_context_java.c
index 7f39d18..bd56c84 100644 (file)
@@ -10,7 +10,6 @@
 #include <xbt/function_types.h>
 #include <simix/simix.h>
 #include "smx_context_java.h"
-#include "simix/process_private.h"
 #include "xbt/dynar.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jmsg, bindings, "MSG for Java(TM)");
@@ -66,7 +65,7 @@ smx_ctx_java_factory_create_context(xbt_main_func_t code, int argc,
                                     void_pfn_smxprocess_t cleanup_func,
                                     void* data)
 {
-  fprintf(stderr,"XXXX Create Context\n");
+  DEBUG0("XXXX Create Context\n");
   smx_ctx_java_t context = xbt_new0(s_smx_ctx_java_t, 1);
 
   /* If the user provided a function for the process then use it
@@ -107,7 +106,7 @@ static void smx_ctx_java_free(smx_context_t context)
 static void smx_ctx_java_stop(smx_context_t context)
 {
   jobject jprocess = NULL;
-  fprintf(stderr,"XXXX Context Stop\n");
+  DEBUG0("XXXX Context Stop\n");
 
   smx_ctx_java_t ctx_java;
 
@@ -149,24 +148,24 @@ static void smx_ctx_java_suspend(smx_context_t context)
 // FIXME: inline those functions
 static void smx_ctx_java_resume(smx_context_t new_context)
 {
-  fprintf(stderr,"XXXX Context Resume\n");
+  DEBUG0("XXXX Context Resume\n");
   jprocess_schedule(new_context);
 }
 
 static void smx_ctx_java_runall(xbt_dynar_t processes)
 {
-  fprintf(stderr,"XXXX Run all\n");
+  DEBUG0("XXXX Run all\n");
   smx_process_t process;
   smx_context_t old_context;
   unsigned int cursor;
 
   xbt_dynar_foreach(processes, cursor, process) {
     old_context = my_current_context;
-    my_current_context = process->context;
+    my_current_context = SIMIX_process_get_context(process);
     smx_ctx_java_resume(my_current_context);
     my_current_context = old_context;
   }
   xbt_dynar_reset(processes);
 
-  fprintf(stderr,"XXXX End of run all\n");
+  DEBUG0("XXXX End of run all\n");
 }