X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/93b7fb3201585c6c2734b41565cddd8ee9591146..00a6b9c372041854e4d53ca0470ac2c038f96d93:/src/jmsg.c diff --git a/src/jmsg.c b/src/jmsg.c index 2e8c1d5744..30b5c2a61a 100644 --- a/src/jmsg.c +++ b/src/jmsg.c @@ -280,9 +280,16 @@ Java_org_simgrid_msg_MsgNative_processSelf(JNIEnv * env, jclass cls) } JNIEXPORT void JNICALL -Java_org_simgrid_msg_MsgNative_processChangeHost(JNIEnv * env, jclass cls, - jobject jhost) +Java_org_simgrid_msg_MsgNative_processMigrate(JNIEnv * env, jclass cls, + jobject jprocess, jobject jhost) { + m_process_t process = jprocess_to_native_process(jprocess, env); + + if (!process) { + jxbt_throw_notbound(env, "process", jprocess); + return; + } + m_host_t host = jhost_get_native(env, jhost); if (!host) { @@ -291,9 +298,8 @@ Java_org_simgrid_msg_MsgNative_processChangeHost(JNIEnv * env, jclass cls, } /* try to change the host of the process */ - MSG_error_t rv = MSG_process_change_host(host); - - jxbt_check_res("MSG_process_change_host()", rv, MSG_OK, + MSG_error_t rv = MSG_process_migrate(process, host); + jxbt_check_res("MSG_process_migrate()", rv, MSG_OK, bprintf("unexpected error , please report this bug")); } @@ -840,7 +846,6 @@ JNIEXPORT void JNICALL jxbt_check_res("MSG_clean()", rv, MSG_OK, bprintf ("unexpected error : MSG_clean() failed .. please report this bug ")); - } JNIEXPORT jint JNICALL @@ -875,7 +880,7 @@ Java_org_simgrid_msg_MsgNative_processExit(JNIEnv * env, jclass cls, return; } - MSG_process_kill(process); + smx_ctx_java_stop(MSG_process_get_smx_ctx(process)); } JNIEXPORT void JNICALL