xbt_os_mutex_acquire(simix_global->mutex);
/* cancel non-blocking communications */
- smx_synchro_t synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
+ smx_activity_t synchro = static_cast<smx_activity_t>(xbt_fifo_pop(process->comms));
while (synchro != nullptr) {
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
} else {
xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro);
}
- synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
+ synchro = static_cast<smx_activity_t>(xbt_fifo_pop(process->comms));
}
XBT_DEBUG("%p should not be run anymore",process);
}
}
-/**
- * \brief Creates and runs the maestro process
- */
+/** @brief Creates and runs the maestro process */
void SIMIX_maestro_create(void (*code)(void*), void* data)
{
simgrid::simix::create_maestro(std::bind(code, data));
/* Tracing the process creation */
TRACE_msg_process_create(process->name.c_str(), process->pid, process->host);
- auto context = dynamic_cast<simgrid::simix::AttachContext*>(process->context);
+ auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
if (!context)
xbt_die("Not a suitable context");
void SIMIX_process_detach()
{
- auto context = dynamic_cast<simgrid::simix::AttachContext*>(SIMIX_context_self());
+ auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(SIMIX_context_self());
if (!context)
xbt_die("Not a suitable context");
// Let maestro ignore we are still alive:
// xbt_swag_remove(context->process(), simix_global->process_list);
- // TODDO, Remove from proces list:
+ // TODO, Remove from proces list:
// xbt_swag_remove(process, sg_host_simix(host)->process_list);
context->attach_stop();
void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process)
{
- smx_synchro_t sync_suspend = SIMIX_process_suspend(process, simcall->issuer);
+ smx_activity_t sync_suspend = SIMIX_process_suspend(process, simcall->issuer);
if (process != simcall->issuer) {
SIMIX_simcall_answer(simcall);
/* If we are suspending ourselves, then just do not finish the simcall now */
}
-smx_synchro_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+smx_activity_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
{
if (process->suspended) {
XBT_DEBUG("Process '%s' is already suspended", process->name.c_str());
SIMIX_simcall_answer(simcall);
return;
}
- smx_synchro_t sync = SIMIX_process_join(simcall->issuer, process, timeout);
+ smx_activity_t sync = SIMIX_process_join(simcall->issuer, process, timeout);
sync->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = sync;
}
-static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t synchro){
+static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activity_t synchro){
simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
if (sleep->surf_sleep) {
return 0;
}
-smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
+smx_activity_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
{
- smx_synchro_t res = SIMIX_process_sleep(issuer, timeout);
- static_cast<simgrid::kernel::activity::Synchro*>(res)->ref();
+ smx_activity_t res = SIMIX_process_sleep(issuer, timeout);
+ static_cast<simgrid::kernel::activity::ActivityImpl*>(res)->ref();
SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
return res;
}
SIMIX_simcall_answer(simcall);
return;
}
- smx_synchro_t sync = SIMIX_process_sleep(simcall->issuer, duration);
+ smx_activity_t sync = SIMIX_process_sleep(simcall->issuer, duration);
sync->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = sync;
}
-smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration)
+smx_activity_t SIMIX_process_sleep(smx_process_t process, double duration)
{
sg_host_t host = process->host;
return synchro;
}
-void SIMIX_process_sleep_destroy(smx_synchro_t synchro)
+void SIMIX_process_sleep_destroy(smx_activity_t synchro)
{
XBT_DEBUG("Destroy synchro %p", synchro);
simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);