X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45c3f1cfee86fb48c96d53f8267f99b6db6e3d7a..2ff790487fd26573becedc9cf6adfdbba7f068d0:/src/bindings/java/smx_context_java.c diff --git a/src/bindings/java/smx_context_java.c b/src/bindings/java/smx_context_java.c index de3518834b..ce2d01e0d5 100644 --- a/src/bindings/java/smx_context_java.c +++ b/src/bindings/java/smx_context_java.c @@ -96,7 +96,7 @@ static void* smx_ctx_java_thread_run(void *data) { xbt_os_thread_set_extra_data(context); //Attach the thread to the JVM JNIEnv *env; - jint error = (*__java_vm)->AttachCurrentThread(__java_vm, (void **) &env, NULL); + _XBT_GNUC_UNUSED jint error = (*__java_vm)->AttachCurrentThread(__java_vm, (void **) &env, NULL); xbt_assert((error == JNI_OK), "The thread could not be attached to the JVM"); context->jenv = get_current_thread_env(); //Wait for the first scheduling round to happen. @@ -153,14 +153,16 @@ void smx_ctx_java_stop(smx_context_t context) if (context->iwannadie) { context->iwannadie = 0; JNIEnv *env = get_current_thread_env(); - jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", xbt_strdup("Process killed :)")); + XBT_DEBUG("Gonnal launch Killed Error"); + jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", bprintf("Process %s killed: ", MSG_process_get_name( (msg_process_t)context))); + XBT_DEBUG("Trigger a cancel error at the C level"); THROWF(cancel_error, 0, "process cancelled"); } else { smx_ctx_base_stop(context); /* detach the thread and kills it */ JNIEnv *env = ctx_java->jenv; (*env)->DeleteGlobalRef(env,ctx_java->jprocess); - jint error = (*__java_vm)->DetachCurrentThread(__java_vm); + _XBT_GNUC_UNUSED jint error = (*__java_vm)->DetachCurrentThread(__java_vm); xbt_assert((error == JNI_OK), "The thread couldn't be detached."); xbt_os_sem_release(((smx_ctx_java_t)context)->end); xbt_os_thread_exit(NULL);