X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dff9e15c44ab6340d27215957c56fa72fad246a2..a5c439094f924970556f57605c6bab819ab73725:/src/simix/smx_synchro.c diff --git a/src/simix/smx_synchro.c b/src/simix/smx_synchro.c index 92ac1a0273..cabc1f481e 100644 --- a/src/simix/smx_synchro.c +++ b/src/simix/smx_synchro.c @@ -49,14 +49,14 @@ void SIMIX_mutex_lock(smx_mutex_t mutex) if (mutex->refcount) { /* somebody using the mutex, block */ xbt_swag_insert(self, mutex->sleeping); - self->simdata->mutex = mutex; + self->mutex = mutex; /* wait for some process make the unlock and wake up me from mutex->sleeping */ - xbt_context_yield(); - self->simdata->mutex = NULL; + __SIMIX_process_yield(); + self->mutex = NULL; /* verify if the process was suspended */ - while (self->simdata->suspended) { - xbt_context_yield(); + while (self->suspended) { + __SIMIX_process_yield(); } mutex->refcount = 1; @@ -148,7 +148,7 @@ smx_cond_t SIMIX_cond_init() /** * \brief Signalizes a condition. * - * Signalizes a condition and wakes up a sleping process. If there are no process sleeping, no action is done. + * Signalizes a condition and wakes up a sleeping process. If there are no process sleeping, no action is done. * \param cond A condition */ void SIMIX_cond_signal(smx_cond_t cond) @@ -211,12 +211,12 @@ void __SIMIX_cond_wait(smx_cond_t cond) /* process status */ - self->simdata->cond = cond; + self->cond = cond; xbt_swag_insert(self, cond->sleeping); - xbt_context_yield(); - self->simdata->cond = NULL; - while (self->simdata->suspended) { - xbt_context_yield(); + __SIMIX_process_yield(); + self->cond = NULL; + while (self->suspended) { + __SIMIX_process_yield(); } return; @@ -326,7 +326,7 @@ void SIMIX_cond_display_info(smx_cond_t cond) INFO0("Blocked process on this condition:"); xbt_swag_foreach(process, cond->sleeping) { INFO2("\t %s running on host %s", process->name, - process->simdata->smx_host->name); + process->smx_host->name); } } }