* until run_jprocess(), IIUC.
*/
jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed");
- // XBT_ERROR("Cannot detach the current thread");
- // simgrid::xbt::Backtrace().display();
+ XBT_DEBUG("Cannot detach the current thread");
}
}
env->ExceptionClear();
XBT_ATTRIB_UNUSED jint error = __java_vm->DetachCurrentThread();
xbt_assert(error == JNI_OK, "Cannot detach failing thread");
- // simgrid::xbt::Backtrace().display();
simgrid::kernel::context::throw_stoprequest();
}
}
Msg.info("Unexpected behavior. Stopping now");
System.exit(1);
}
- catch(ProcessKilledError pk) {
- /* The process was killed before its end. With a kill() or something. */
- //Msg.info("Forwarding a PKE");
- throw pk;
- }
+ /* Let the ProcessKilledError (that we'd get if the process is forcefully killed) flow back to the caller */
}
/**
if (! t.isDaemon() && !t.getName().equals("main"))
ids.add(t.getId());
}
- if (ids.size() > 0) {
- long[] id_array = new long[ids.size()];
+ if (! ids.isEmpty()) {
+ long[] idArray = new long[ids.size()];
for (int i=0; i<ids.size(); i++)
- id_array[i] = ids.get(i);
+ idArray[i] = ids.get(i);
- final ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(id_array, true, true);
+ final ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(idArray, true, true);
final StringBuilder dump = new StringBuilder();
for (ThreadInfo threadInfo : threadInfos) {
dump.append('"');