this->register_simcall(&issuer_->simcall_); // Block on that acquisition
if (granted_) {
- post();
+ finish();
} else if (timeout > 0) {
model_action_ = get_issuer()->get_host()->get_cpu()->sleep(timeout);
model_action_->set_activity(this);
// Already in the queue
}
}
-void SemAcquisitionImpl::post()
-{
- finish();
-}
void SemAcquisitionImpl::finish()
{
xbt_assert(simcalls_.size() == 1, "Unexpected number of simcalls waiting: %zu", simcalls_.size());
void SemAcquisitionImpl::cancel()
{
/* Remove myself from the list of interested parties */
- auto issuer = get_issuer();
+ const auto* issuer = get_issuer();
auto it = std::find_if(semaphore_->ongoing_acquisitions_.begin(), semaphore_->ongoing_acquisitions_.end(),
[issuer](SemAcquisitionImplPtr acqui) { return acqui->get_issuer() == issuer; });
xbt_assert(it != semaphore_->ongoing_acquisitions_.end(),
acqui->granted_ = true;
if (acqui == acqui->get_issuer()->waiting_synchro_)
- acqui->post();
+ acqui->finish();
// else, the issuer is not blocked on this acquisition so no need to release it
} else {