Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
code simplification by using directly the function we needed instead of a wrapper
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Mar 2017 20:49:51 +0000 (21:49 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Mar 2017 21:46:32 +0000 (22:46 +0100)
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg_process.cpp

index 5cf85c5..b6c1701 100644 (file)
@@ -329,8 +329,7 @@ void java_main_jprocess(jobject jprocess)
   JNIEnv *env = get_current_thread_env();
   simgrid::kernel::context::JavaContext* context = static_cast<simgrid::kernel::context::JavaContext*>(SIMIX_context_self());
   context->jprocess = jprocess;
-  msg_process_t process = MSG_process_self();
-  jprocess_bind(context->jprocess, process, env);
+  jprocess_bind(context->jprocess, MSG_process_self(), env);
 
   run_jprocess(env, context->jprocess);
 }
index 8094762..a992990 100644 (file)
@@ -104,18 +104,16 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv * env, jobject
   }
 
   /* Actually build the MSG process */
-  msg_process_t process = MSG_process_create_with_environment(name,
-                                                              [](int argc, char** argv) -> int {
-                                                                // This is the jprocess passed as process data.
-                                                                // It would be simpler if we could use a closure.
-                                                                jobject jprocess =
-                                                                    (jobject)MSG_process_get_data(MSG_process_self());
-                                                                simgrid::kernel::context::java_main_jprocess(jprocess);
-                                                                return 0;
-                                                              },
-                                                              jprocess, host,
-                                                              /*argc, argv, properties*/
-                                                              0, nullptr, nullptr);
+  msg_process_t process = MSG_process_create_from_stdfunc(name,
+                                                          []() -> int {
+                                                            // This is the jprocess passed as process data.
+                                                            // It would be simpler if we could use a closure.
+                                                            jobject jprocess =
+                                                                (jobject)MSG_process_get_data(MSG_process_self());
+                                                            simgrid::kernel::context::java_main_jprocess(jprocess);
+                                                            return 0;
+                                                          },
+                                                          jprocess, host, /* properties*/ nullptr);
 
   env->ReleaseStringUTFChars(jname, name);
   /* bind the java process instance to the native process */