XBT_IN("(%p, %f)",smx_host,timeout);
simgrid::simix::Raw *sync = new simgrid::simix::Raw();
- sync->name = nullptr;
sync->sleep = surf_host_sleep(smx_host, timeout);
sync->sleep->setData(sync);
XBT_OUT();
void SIMIX_synchro_finish(smx_synchro_t synchro)
{
XBT_IN("(%p)",synchro);
- smx_simcall_t simcall = (smx_simcall_t) xbt_fifo_shift(synchro->simcalls);
+ smx_simcall_t simcall = synchro->simcalls.front();
+ synchro->simcalls.pop_front();
switch (synchro->state) {
smx_mutex_t SIMIX_mutex_init(void)
{
XBT_IN("()");
- s_smx_process_t p; /* useful to initialize sleeping swag */
+ simgrid::simix::Process p; /* useful to initialize sleeping swag */
smx_mutex_t mutex = xbt_new0(s_smx_mutex_t, 1);
mutex->locked = 0;
/* FIXME: check if the host is active ? */
/* Somebody using the mutex, use a synchronization to get host failures */
synchro = SIMIX_synchro_wait(process->host, -1);
- xbt_fifo_push(synchro->simcalls, simcall);
+ synchro->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = synchro;
xbt_swag_insert(simcall->issuer, mutex->sleeping);
} else {
smx_cond_t SIMIX_cond_init(void)
{
XBT_IN("()");
- s_smx_process_t p;
+ simgrid::simix::Process p;
smx_cond_t cond = xbt_new0(s_smx_cond_t, 1);
cond->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
cond->mutex = NULL;
}
synchro = SIMIX_synchro_wait(issuer->host, timeout);
- xbt_fifo_unshift(synchro->simcalls, simcall);
+ synchro->simcalls.push_front(simcall);
issuer->waiting_synchro = synchro;
xbt_swag_insert(simcall->issuer, cond->sleeping);
XBT_OUT();
smx_sem_t SIMIX_sem_init(unsigned int value)
{
XBT_IN("(%u)",value);
- s_smx_process_t p;
+ simgrid::simix::Process p;
smx_sem_t sem = xbt_new0(s_smx_sem_t, 1);
sem->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
XBT_DEBUG("Wait semaphore %p (timeout:%f)", sem, timeout);
if (sem->value <= 0) {
synchro = SIMIX_synchro_wait(issuer->host, timeout);
- xbt_fifo_unshift(synchro->simcalls, simcall);
+ synchro->simcalls.push_front(simcall);
issuer->waiting_synchro = synchro;
xbt_swag_insert(issuer, sem->sleeping);
} else {