-simgrid::kernel::activity::ExecImpl::ExecImpl(std::string name, std::string tracing_category,
- resource::Action* timeout_detector, s4u::Host* host)
- : ActivityImpl(name), host_(host), timeout_detector_(timeout_detector)
+void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro)
+{
+ XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state_);
+
+ /* Associate this simcall to the synchro */
+ synchro->simcalls_.push_back(simcall);
+ simcall->issuer->waiting_synchro = synchro;
+
+ /* set surf's synchro */
+ if (MC_is_active() || MC_record_replay_is_active()) {
+ synchro->state_ = SIMIX_DONE;
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro)->finish();
+ return;
+ }
+
+ /* If the synchro is already finished then perform the error handling */
+ if (synchro->state_ != SIMIX_RUNNING)
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro)->finish();
+}
+
+void simcall_HANDLER_execution_test(smx_simcall_t simcall, smx_activity_t synchro)
+{
+ int res = (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING);
+ if (res) {
+ synchro->simcalls_.push_back(simcall);
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro)->finish();
+ } else {
+ SIMIX_simcall_answer(simcall);
+ }
+ simcall_execution_test__set__result(simcall, res);
+}
+
+namespace simgrid {
+namespace kernel {
+namespace activity {
+
+ExecImpl::ExecImpl(std::string name, std::string tracing_category, resource::Action* timeout_detector, s4u::Host* host)
+ : ActivityImpl(std::move(name)), host_(host), timeout_detector_(timeout_detector)