/* Functions related to the java process instances. */
-/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved. */
/* 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. */
auto jname = (jstring)env->GetObjectField(jprocess, jprocess_field_Process_name);
const char* name = env->GetStringUTFChars(jname, nullptr);
auto actor_code = [jprocess]() { simgrid::kernel::context::java_main_jprocess(jprocess); };
- smx_actor_t self = SIMIX_process_self();
+ auto self = simgrid::kernel::actor::ActorImpl::self();
sg_host_t host = jhost_get_native(env, jhost);
- smx_actor_t actor = simgrid::kernel::actor::simcall([name, actor_code, host, self] {
+ auto* actor = simgrid::kernel::actor::simcall_answered([name, actor_code, host, self] {
return simgrid::kernel::actor::ActorImpl::create(std::move(name), std::move(actor_code), nullptr, host, self).get();
});
sg_actor_yield();
auto const* actor = sg_actor_by_pid(pid);
if (not actor) {
- jxbt_throw_process_not_found(env, std::string("PID = ") + std::to_string(static_cast<int>(pid)));
+ jxbt_throw_process_not_found(env, "PID = " + std::to_string(static_cast<int>(pid)));
return nullptr;
}
jxbt_throw_notbound(env, "process", jprocess);
return nullptr;
}
- const char* name = env->GetStringUTFChars((jstring)jname, nullptr);
+ jstring_wrapper name(env, (jstring)jname);
const char* property = actor->get_property(name);
if (not property)
jobject jproperty = env->NewStringUTF(property);
- env->ReleaseStringUTFChars((jstring)jname, name);
-
return jproperty;
}