/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <xbt/ex.hpp>
-
#include "jmsg_process.h"
#include "JavaContext.hpp"
#include "jmsg.hpp"
#include "jmsg_host.h"
#include "jxbt_utilities.hpp"
+#include "simgrid/Exception.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
{
simgrid::kernel::context::JavaContext* context =
(simgrid::kernel::context::JavaContext*)process->get_impl()->context_;
- return context->jprocess;
+ return context->jprocess_;
}
jobject jprocess_ref(jobject jprocess, JNIEnv* env)
/*data*/ nullptr, jhost_get_native(env, jhost), /* properties*/ nullptr);
env->ReleaseStringUTFChars(jname, name);
- /* bind the java process instance to the native process */
- jprocess_bind(jprocess, process, env);
-
/* Retrieve the kill time from the process */
jdouble jkill = env->GetDoubleField(jprocess, jprocess_field_Process_killTime);
MSG_process_set_kill_time(process, (double)jkill);
{
double time = ((double)jmillis) / 1000 + ((double)jnanos) / 1000000000;
msg_error_t rv;
- rv = MSG_process_sleep(time);
+ try {
+ rv = MSG_process_sleep(time);
+ } catch (simgrid::kernel::context::Context::StopRequest const&) {
+ rv = MSG_HOST_FAILURE;
+ }
if (rv != MSG_OK) {
XBT_DEBUG("Something during the MSG_process_sleep invocation was wrong, trigger a HostFailureException");