/* 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. */
/* 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. */
- xbt_assert((!simdata->compute) && !task->simdata->isused, "This task is executed somewhere else. Go fix your code!");
+ xbt_assert((not simdata->compute) && not task->simdata->isused,
+ "This task is executed somewhere else. Go fix your code!");
XBT_DEBUG("According to the JAVA API, a sleep call should only deal with HostFailureException, I'm lost.");
// adsein: MSG_TASK_CANCELED is assigned when someone kills the process that made the sleep, this is not
// correct. For instance, when the node is turned off, the error should be MSG_HOST_FAILURE, which is by the way
XBT_DEBUG("According to the JAVA API, a sleep call should only deal with HostFailureException, I'm lost.");
// adsein: MSG_TASK_CANCELED is assigned when someone kills the process that made the sleep, this is not
// correct. For instance, when the node is turned off, the error should be MSG_HOST_FAILURE, which is by the way
// and did not change anythings at the C level.
// See comment in the jmsg_process.c file, function JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
status = MSG_TASK_CANCELED;
// and did not change anythings at the C level.
// See comment in the jmsg_process.c file, function JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
status = MSG_TASK_CANCELED;
simcall_comm_recv(MSG_process_self()->getImpl(), mailbox->getImpl(), task, nullptr, nullptr, nullptr, nullptr, timeout, rate);
XBT_DEBUG("Got task %s from %s",(*task)->name,mailbox->name());
(*task)->simdata->setNotUsed();
simcall_comm_recv(MSG_process_self()->getImpl(), mailbox->getImpl(), task, nullptr, nullptr, nullptr, nullptr, timeout, rate);
XBT_DEBUG("Got task %s from %s",(*task)->name,mailbox->name());
(*task)->simdata->setNotUsed();
comm = xbt_new0(s_msg_comm_t, 1);
comm->task_sent = task;
comm->task_received = nullptr;
comm = xbt_new0(s_msg_comm_t, 1);
comm->task_sent = task;
comm->task_received = nullptr;
if (status == MSG_OK && comm->task_received != nullptr) {
/* I am the receiver */
(*comm->task_received)->simdata->setNotUsed();
if (status == MSG_OK && comm->task_received != nullptr) {
/* I am the receiver */
(*comm->task_received)->simdata->setNotUsed();
msg_process_t process = MSG_process_self();
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(alias);
msg_process_t process = MSG_process_self();
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(alias);
simcall_set_category(comm, task->category);
t_simdata->comm = static_cast<simgrid::kernel::activity::Comm*>(comm);
simcall_comm_wait(comm, timeout);
simcall_set_category(comm, task->category);
t_simdata->comm = static_cast<simgrid::kernel::activity::Comm*>(comm);
simcall_comm_wait(comm, timeout);
int MSG_task_listen(const char *alias)
{
simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(alias);
int MSG_task_listen(const char *alias)
{
simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(alias);
simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(alias);
simgrid::kernel::activity::Comm* comm = static_cast<simgrid::kernel::activity::Comm*>(mbox->front());
simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(alias);
simgrid::kernel::activity::Comm* comm = static_cast<simgrid::kernel::activity::Comm*>(mbox->front());