}
SIMIX_synchro_stop_waiting(simcall->issuer, simcall);
- simcall->issuer->waiting_synchro = NULL;
+ simcall->issuer->waiting_synchro = nullptr;
delete synchro;
SIMIX_simcall_answer(simcall);
XBT_OUT();
{
XBT_IN("(%p)",simcall);
/* FIXME: check where to validate the arguments */
- smx_synchro_t synchro = NULL;
+ smx_synchro_t synchro = nullptr;
smx_process_t process = simcall->issuer;
if (mutex->locked) {
/*process to wake up */
smx_process_t p = (smx_process_t) xbt_swag_extract(mutex->sleeping);
delete p->waiting_synchro;
- p->waiting_synchro = NULL;
+ p->waiting_synchro = nullptr;
mutex->owner = p;
SIMIX_simcall_answer(&p->simcall);
} else {
/* nobody to wake up */
mutex->locked = 0;
- mutex->owner = NULL;
+ mutex->owner = nullptr;
}
XBT_OUT();
}
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;
+ cond->mutex = nullptr;
XBT_OUT();
return cond;
}
smx_process_t issuer, smx_simcall_t simcall)
{
XBT_IN("(%p, %p, %f, %p,%p)",cond,mutex,timeout,issuer,simcall);
- smx_synchro_t synchro = NULL;
+ smx_synchro_t synchro = nullptr;
XBT_DEBUG("Wait condition %p", cond);
/* If there is a mutex unlock it */
/* FIXME: what happens if the issuer is not the owner of the mutex? */
- if (mutex != NULL) {
+ if (mutex != nullptr) {
cond->mutex = mutex;
SIMIX_mutex_unlock(mutex, issuer);
}
void SIMIX_cond_signal(smx_cond_t cond)
{
XBT_IN("(%p)",cond);
- smx_process_t proc = NULL;
- smx_mutex_t mutex = NULL;
- smx_simcall_t simcall = NULL;
+ smx_process_t proc = nullptr;
+ smx_mutex_t mutex = nullptr;
+ smx_simcall_t simcall = nullptr;
XBT_DEBUG("Signal condition %p", cond);
/* Destroy waiter's synchronization */
delete proc->waiting_synchro;
- proc->waiting_synchro = NULL;
+ proc->waiting_synchro = nullptr;
/* Now transform the cond wait simcall into a mutex lock one */
simcall = &proc->simcall;
XBT_IN("(%p)",cond);
XBT_DEBUG("Destroy condition %p", cond);
- if (cond != NULL) {
+ if (cond != nullptr) {
xbt_assert(xbt_swag_size(cond->sleeping) == 0,
"Cannot destroy conditional since someone is still using it");
{
XBT_IN("(%p)",sem);
XBT_DEBUG("Destroy semaphore %p", sem);
- if (sem != NULL) {
+ if (sem != nullptr) {
xbt_assert(xbt_swag_size(sem->sleeping) == 0,
"Cannot destroy semaphore since someone is still using it");
xbt_swag_free(sem->sleeping);
XBT_DEBUG("Sem release semaphore %p", sem);
if ((proc = (smx_process_t) xbt_swag_extract(sem->sleeping))) {
delete proc->waiting_synchro;
- proc->waiting_synchro = NULL;
+ proc->waiting_synchro = nullptr;
SIMIX_simcall_answer(&proc->simcall);
} else if (sem->value < SMX_SEM_NOLIMIT) {
sem->value++;
smx_simcall_t simcall)
{
XBT_IN("(%p, %f, %p, %p)",sem,timeout,issuer,simcall);
- smx_synchro_t synchro = NULL;
+ smx_synchro_t synchro = nullptr;
XBT_DEBUG("Wait semaphore %p (timeout:%f)", sem, timeout);
if (sem->value <= 0) {