-static int SIMIX_process_join_finish(smx_process_exit_status_t status, void* synchro)
-{
- simgrid::kernel::activity::SleepImpl* sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(synchro);
-
- if (sleep->surf_sleep) {
- sleep->surf_sleep->cancel();
-
- while (not sleep->simcalls.empty()) {
- smx_simcall_t simcall = sleep->simcalls.front();
- sleep->simcalls.pop_front();
- simcall_process_sleep__set__result(simcall, SIMIX_DONE);
- simcall->issuer->waiting_synchro = nullptr;
- if (simcall->issuer->suspended) {
- XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
- simcall->issuer->suspended = 0;
- simcall_HANDLER_process_suspend(simcall, simcall->issuer);
- } else {
- SIMIX_simcall_answer(simcall);
- }
- }
- sleep->surf_sleep->unref();
- sleep->surf_sleep = nullptr;
- }
- // intrusive_ptr_release(process); // FIXME: We are leaking here. See comment in SIMIX_process_join()
- return 0;
-}
-