A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
java: well, use a closure if you really want to
[simgrid.git]
/
src
/
bindings
/
java
/
jmsg_process.cpp
diff --git
a/src/bindings/java/jmsg_process.cpp
b/src/bindings/java/jmsg_process.cpp
index
90b43ea
..
e838a68
100644
(file)
--- a/
src/bindings/java/jmsg_process.cpp
+++ b/
src/bindings/java/jmsg_process.cpp
@@
-76,7
+76,6
@@
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv * env, jobject
{
jobject jprocess; /* the global reference to the java process instance */
jstring jname; /* the name of the java process instance */
- msg_process_t process; /* the native process to create */
msg_host_t host; /* Where that process lives */
@@
-105,17
+104,10
@@
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv * env, jobject
}
/* 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 simpler 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_t process = MSG_process_create_from_stdfunc(
+ name, [jprocess]() -> void { simgrid::kernel::context::java_main_jprocess(jprocess); },
+ /*data*/ nullptr, host, /* properties*/ nullptr);
+
env->ReleaseStringUTFChars(jname, name);
/* bind the java process instance to the native process */
jprocess_bind(jprocess, process, env);
@@
-290,7
+282,7
@@
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cl
// is a cancelled_error, see bindings/java/smx_context_java.c, function void smx_ctx_java_stop(smx_context_t context) and src/msg/msg_gos.c
// function msg_error_t MSG_process_sleep(double nb_sec)
- jxbt_throw_host_failure(env,
nullptr
);
+ jxbt_throw_host_failure(env,
""
);
}
}