X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3ae712a1b95294052b6e8136d0f0f2d4b30e6eb..2c69087d11c54eee924f6870373883d6aa9ff228:/src/bindings/java/jmsg_process.c diff --git a/src/bindings/java/jmsg_process.c b/src/bindings/java/jmsg_process.c index 7bb72ea46a..a65f183b7f 100644 --- a/src/bindings/java/jmsg_process.c +++ b/src/bindings/java/jmsg_process.c @@ -225,7 +225,7 @@ Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject return jproperty; } JNIEXPORT jobject JNICALL -Java_org_simgrid_msg_Process_currentProcess(JNIEnv * env, jclass cls) +Java_org_simgrid_msg_Process_getCurrentProcess(JNIEnv * env, jclass cls) { msg_process_t process = MSG_process_self(); jobject jprocess; @@ -340,7 +340,16 @@ Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint msg_error_t rv; rv = MSG_process_sleep(time); if (rv != MSG_OK) { - jmsg_throw_status(env,rv); + XBT_DEBUG("Something during the MSG_process_sleep invocation was wrong, trigger a HostFailureException"); + + //jmsg_throw_status(env,rv); + + // adsein, the code above as been replaced by the code below. Indeed, according to the documentation, a sleep can only + // trigger a host_failure exception. When the sleep crashes due to a host shutdown, the exception thrown by smx_context_java.c + // 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,NULL); } } JNIEXPORT void JNICALL