/* 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 "src/surf/surf_interface.hpp"
#include "smx_private.h"
#include "xbt/sysdep.h"
#include "xbt/log.h"
static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t sync){
if (sync->sleep.surf_sleep) {
- surf_action_cancel(sync->sleep.surf_sleep);
+ sync->sleep.surf_sleep->cancel();
smx_simcall_t simcall;
while ((simcall = (smx_simcall_t) xbt_fifo_shift(sync->simcalls))) {
SIMIX_simcall_answer(simcall);
}
}
- surf_action_unref(sync->sleep.surf_sleep);
+ sync->sleep.surf_sleep->unref();
sync->sleep.surf_sleep = NULL;
}
xbt_mallocator_release(simix_global->synchro_mallocator, sync);
synchro->sleep.host = host;
synchro->sleep.surf_sleep = surf_host_sleep(host, duration);
- surf_action_set_data(synchro->sleep.surf_sleep, synchro);
+ synchro->sleep.surf_sleep->setData(synchro);
XBT_DEBUG("Create sleep synchronization %p", synchro);
return synchro;
while ((simcall = (smx_simcall_t) xbt_fifo_shift(synchro->simcalls))) {
- switch(surf_action_get_state(synchro->sleep.surf_sleep)){
+ switch (synchro->sleep.surf_sleep->getState()){
case SURF_ACTION_FAILED:
simcall->issuer->context->iwannadie = 1;
//SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
xbt_assert(synchro->type == SIMIX_SYNC_SLEEP || synchro->type == SIMIX_SYNC_JOIN);
if (synchro->sleep.surf_sleep) {
- surf_action_unref(synchro->sleep.surf_sleep);
+ synchro->sleep.surf_sleep->unref();
synchro->sleep.surf_sleep = NULL;
}
if (synchro->type == SIMIX_SYNC_SLEEP)
void SIMIX_process_sleep_suspend(smx_synchro_t synchro)
{
xbt_assert(synchro->type == SIMIX_SYNC_SLEEP);
- surf_action_suspend(synchro->sleep.surf_sleep);
+ synchro->sleep.surf_sleep->suspend();
}
void SIMIX_process_sleep_resume(smx_synchro_t synchro)
{
XBT_DEBUG("Synchro state is %d on process_sleep_resume.", synchro->state);
xbt_assert(synchro->type == SIMIX_SYNC_SLEEP);
- surf_action_resume(synchro->sleep.surf_sleep);
+ synchro->sleep.surf_sleep->resume();
}
/**