/** Ask the actor to die.
*
* It will only notice your request when doing a simcall next time (a communication or similar).
- * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues.
+ * SimGrid sometimes have issues when you kill actors that are currently communicating and such.
+ * We are working on it to fix the issues.
*/
void kill();
XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process);
XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data);
XBT_PUBLIC(void) simcall_process_set_host(smx_process_t process, sg_host_t dest);
-XBT_PUBLIC(const char *) simcall_process_get_name(smx_process_t process);
XBT_PUBLIC(int) simcall_process_get_PID(smx_process_t process);
XBT_PUBLIC(int) simcall_process_get_PPID(smx_process_t process);
XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process);
*/
const char *MSG_process_get_name(msg_process_t process)
{
- xbt_assert(process != nullptr, "Invalid parameter: First argument must not be nullptr");
- return simcall_process_get_name(process);
+ return process->name.c_str();
}
/** \ingroup m_process_management
}
const char* Actor::getName() {
- return simcall_process_get_name(pimpl_);
+ return pimpl_->name.c_str();
}
int Actor::getPid(){
return SIMIX_timer_get_date(process->kill_timer);
}
-/**
- * \ingroup simix_process_management
- * \brief Return the name of an agent.
- *
- * This functions checks whether \a process is a valid pointer or not and return its name.
- * \param process SIMIX process
- * \return The process name
- */
-const char* simcall_process_get_name(smx_process_t process)
-{
- return SIMIX_process_get_name(process);
-}
-
/**
* \ingroup simix_process_management
* \brief Returns true if the process is suspended .
break;
case SIMCALL_NONE:
THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
- SIMIX_process_get_name(simcall->issuer),
+ simcall->issuer->name.c_str(),
sg_host_get_name(simcall->issuer->host)
);
break;
fd.write(' case NUM_SIMCALLS:\n')
fd.write(' break;\n')
fd.write(' case SIMCALL_NONE:\n')
- fd.write(
- ' THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",\n')
- fd.write(' SIMIX_process_get_name(simcall->issuer),\n')
- fd.write(
- ' sg_host_get_name(simcall->issuer->host)\n')
+ fd.write(' THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",\n')
+ fd.write(' simcall->issuer->name.c_str(),\n')
+ fd.write(' sg_host_get_name(simcall->issuer->host)\n')
fd.write(' );\n')
fd.write(' break;\n')
fd.write('\n')
if (process == nullptr || process == simix_global->maestro_process)
return "maestro";
- return SIMIX_process_get_name(process);
-}
-
-const char* SIMIX_process_get_name(smx_process_t process)
-{
return process->name.c_str();
}
XBT_PRIVATE int SIMIX_process_get_PPID(smx_process_t self);
XBT_PRIVATE void* SIMIX_process_get_data(smx_process_t process);
XBT_PRIVATE void SIMIX_process_set_data(smx_process_t process, void *data);
-XBT_PRIVATE const char* SIMIX_process_get_name(smx_process_t process);
XBT_PRIVATE smx_process_t SIMIX_process_get_by_name(const char* name);
XBT_PRIVATE int SIMIX_process_is_suspended(smx_process_t process);
XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties(smx_process_t process);
/* If the mutex is not owned by the issuer, that's not good */
if (issuer != this->owner)
THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%d), not by you.",
- SIMIX_process_get_name(this->owner),SIMIX_process_get_PID(this->owner));
+ this->owner->name.c_str(),SIMIX_process_get_PID(this->owner));
if (xbt_swag_size(this->sleeping) > 0) {
/*process to wake up */