-/* 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. */
} else if (surf_action_->get_state() == resource::Action::State::FINISHED) {
state_ = State::SRC_TIMEOUT;
}
+
+ clean_action();
+ /* Answer all simcalls associated with the synchro */
finish();
}
xbt_die("Internal error in RawImpl::finish() unexpected synchro state %d", static_cast<int>(state_));
}
- switch (simcall->call_) {
- case SIMCALL_MUTEX_LOCK:
- simcall_mutex_lock__get__mutex(simcall)->remove_sleeping_actor(*simcall->issuer_);
- break;
-
- case SIMCALL_COND_WAIT:
- simcall_cond_wait_timeout__get__cond(simcall)->remove_sleeping_actor(*simcall->issuer_);
- break;
-
- case SIMCALL_COND_WAIT_TIMEOUT:
- simcall_cond_wait_timeout__get__cond(simcall)->remove_sleeping_actor(*simcall->issuer_);
- simcall_cond_wait_timeout__set__result(simcall, 1); // signal a timeout
- break;
-
- case SIMCALL_SEM_ACQUIRE:
- simcall_sem_acquire_timeout__get__sem(simcall)->remove_sleeping_actor(*simcall->issuer_);
- break;
-
- case SIMCALL_SEM_ACQUIRE_TIMEOUT:
- simcall_sem_acquire_timeout__get__sem(simcall)->remove_sleeping_actor(*simcall->issuer_);
- simcall_sem_acquire_timeout__set__result(simcall, 1); // signal a timeout
- break;
-
- default:
- THROW_IMPOSSIBLE;
- }
- simcall->issuer_->waiting_synchro = nullptr;
+ finish_callback_();
+ simcall->issuer_->waiting_synchro_ = nullptr;
simcall->issuer_->simcall_answer();
}