- jdouble jkill = env->GetDoubleField(jprocess, jprocess_field_Process_killTime);
- /* Actually build the MSG process */
- process = MSG_process_create_with_environment(name, [](int argc, char** argv) -> int {
- smx_actor_t process = SIMIX_process_self();
- // This is the jprocess passed as environment.
- // It would be simplet if we could use a closure.
- jobject jprocess = (jobject) MSG_process_get_data(process);
- simgrid::kernel::context::java_main_jprocess(jprocess);
- return 0;
- }, jprocess,
- host,
- /*argc, argv, properties*/
- 0, nullptr, nullptr);
- MSG_process_set_kill_time(process, (double)jkill);
- /* bind the java process instance to the native process */
- jprocess_bind(jprocess, process, env);
-
- /* release our reference to the process name (variable name becomes invalid) */
- //FIXME : This line should be uncommented but with mac it doesn't work. BIG WARNING
- //env->ReleaseStringUTFChars(jname, name);
- env->ReleaseStringUTFChars((jstring) jhostname, hostname);