- /* I am the current process and I am dying */
- if (this->iwannadie) {
- this->iwannadie = 0;
- JNIEnv *env = get_current_thread_env();
- XBT_DEBUG("Gonna launch Killed Error");
- // TODO Adrien, if the process has not been created at the java layer, why should we raise the exception/error at the java level (this happens
- // for instance during the migration process that creates at the C level two processes: one on the SRC node and one on the DST node, if the DST process is killed.
- // it is not required to raise an exception at the JAVA level, the low level should be able to manage such an issue correctly but this is not the case right now unfortunately ...
- // TODO it will be nice to have the name of the process to help the end-user to know which Process has been killed
- // jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", bprintf("Process %s killed :) (file smx_context_java.c)", MSG_process_get_name( (msg_process_t)context) ));
- jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError",
- bprintf("Process %s killed :) (file JavaContext.cpp)",
- simcall_process_get_name((smx_process_t) SIMIX_context_get_process(this))) );
- XBT_DEBUG("Trigger a cancel error at the C level");
- THROWF(cancel_error, 0, "process cancelled");
- } else {
- Context::stop();
- /* detach the thread and kills it */
- JNIEnv *env = this->jenv;
- env->DeleteGlobalRef(this->jprocess);