-/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
/* 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. */
/** @brief Handle a condition waiting simcall with timeouts */
void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout)
{
+ simcall_cond_wait_timeout__set__result(simcall, 0); // default result, will be set to 1 on timeout
cond->wait(mutex, timeout, simcall->issuer_);
}
sleeping_.pop_front();
/* Destroy waiter's synchronization */
- proc.waiting_synchro = nullptr;
+ proc.waiting_synchro_ = nullptr;
/* Now transform the cond wait simcall into a mutex lock one */
- smx_simcall_t simcall = &proc.simcall;
+ smx_simcall_t simcall = &proc.simcall_;
MutexImpl* simcall_mutex;
- if (simcall->call_ == SIMCALL_COND_WAIT)
+ if (simcall->call_ == simix::Simcall::COND_WAIT)
simcall_mutex = simcall_cond_wait__get__mutex(simcall);
else
simcall_mutex = simcall_cond_wait_timeout__get__mutex(simcall);
- simcall->call_ = SIMCALL_MUTEX_LOCK;
+ simcall->call_ = simix::Simcall::MUTEX_LOCK;
simcall_mutex->lock(simcall->issuer_);
}
RawImplPtr synchro(new RawImpl());
synchro->set_host(issuer->get_host()).set_timeout(timeout).start();
- synchro->register_simcall(&issuer->simcall);
+ synchro->register_simcall(&issuer->simcall_);
sleeping_.push_back(*issuer);
}