From 09a0b55d933dfe1b6c5e77c6e6b55be1b4e6da66 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 10 May 2016 12:12:19 +0200 Subject: [PATCH] Use C++ to implement dynamic dispatch Have a look at the code of SIMIX_simcall_exit() to understand what this change is about. --- src/simix/Synchro.h | 1 + src/simix/SynchroComm.cpp | 27 ++++++++++++++++++ src/simix/SynchroComm.hpp | 1 + src/simix/SynchroExec.cpp | 24 ++++++++++++++++ src/simix/SynchroExec.hpp | 1 + src/simix/SynchroIo.cpp | 50 +++++++++++++++++++++++++++++++++ src/simix/SynchroIo.hpp | 1 + src/simix/SynchroRaw.cpp | 20 +++++++++++-- src/simix/SynchroRaw.hpp | 1 + src/simix/SynchroSleep.cpp | 49 ++++++++++++++++++++++++++++++-- src/simix/SynchroSleep.hpp | 1 + src/simix/popping.cpp | 30 +------------------- src/simix/smx_host.cpp | 28 ------------------ src/simix/smx_host_private.h | 2 +- src/simix/smx_io.cpp | 46 ------------------------------ src/simix/smx_network.cpp | 38 ------------------------- src/simix/smx_network_private.h | 1 - src/simix/smx_process.cpp | 40 -------------------------- src/simix/smx_process_private.h | 1 - src/simix/smx_synchro.cpp | 16 +---------- src/simix/smx_synchro_private.h | 2 ++ 21 files changed, 177 insertions(+), 203 deletions(-) diff --git a/src/simix/Synchro.h b/src/simix/Synchro.h index dc5a9496e9..05b28a1009 100644 --- a/src/simix/Synchro.h +++ b/src/simix/Synchro.h @@ -25,6 +25,7 @@ namespace simix { virtual void suspend()=0; virtual void resume()=0; + virtual void post() =0; // What to do when a simcall terminates void ref(); void unref(); diff --git a/src/simix/SynchroComm.cpp b/src/simix/SynchroComm.cpp index b074baa3aa..4342cb107e 100644 --- a/src/simix/SynchroComm.cpp +++ b/src/simix/SynchroComm.cpp @@ -109,3 +109,30 @@ void simgrid::simix::Comm::cleanupSurf() dst_timeout = NULL; } } + +void simgrid::simix::Comm::post() +{ + /* Update synchro state */ + if (src_timeout && src_timeout->getState() == simgrid::surf::Action::State::done) + state = SIMIX_SRC_TIMEOUT; + else if (dst_timeout && dst_timeout->getState() == simgrid::surf::Action::State::done) + state = SIMIX_DST_TIMEOUT; + else if (src_timeout && src_timeout->getState() == simgrid::surf::Action::State::failed) + state = SIMIX_SRC_HOST_FAILURE; + else if (dst_timeout && dst_timeout->getState() == simgrid::surf::Action::State::failed) + state = SIMIX_DST_HOST_FAILURE; + else if (surf_comm && surf_comm->getState() == simgrid::surf::Action::State::failed) { + state = SIMIX_LINK_FAILURE; + } else + state = SIMIX_DONE; + + XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d", + this, (int)state, src_proc, dst_proc, detached); + + /* destroy the surf actions associated with the Simix communication */ + cleanupSurf(); + + /* if there are simcalls associated with the synchro, then answer them */ + if (xbt_fifo_size(simcalls)) + SIMIX_comm_finish(this); +} diff --git a/src/simix/SynchroComm.hpp b/src/simix/SynchroComm.hpp index 6d4d7b7ba5..b58c83cf22 100644 --- a/src/simix/SynchroComm.hpp +++ b/src/simix/SynchroComm.hpp @@ -25,6 +25,7 @@ namespace simix { Comm(e_smx_comm_type_t type); void suspend(); void resume(); + void post() override; void cancel(); double remains(); void cleanupSurf(); // FIXME: make me protected diff --git a/src/simix/SynchroExec.cpp b/src/simix/SynchroExec.cpp index e206b73f44..3b0f2c84b2 100644 --- a/src/simix/SynchroExec.cpp +++ b/src/simix/SynchroExec.cpp @@ -5,6 +5,7 @@ #include "src/simix/SynchroExec.hpp" #include "src/surf/surf_interface.hpp" +#include "src/simix/smx_host_private.h" simgrid::simix::Exec::~Exec() { @@ -30,3 +31,26 @@ double simgrid::simix::Exec::remains() return 0; } + +void simgrid::simix::Exec::post() +{ + if (host && host->isOff()) {/* FIMXE: handle resource failure for parallel tasks too */ + /* If the host running the synchro failed, notice it. This way, the asking + * process can be killed if it runs on that host itself */ + state = SIMIX_FAILED; + } else if (surf_exec->getState() == simgrid::surf::Action::State::failed) { + /* If the host running the synchro didn't fail, then the synchro was canceled */ + state = SIMIX_CANCELED; + } else { + state = SIMIX_DONE; + } + + if (surf_exec) { + surf_exec->unref(); + surf_exec = NULL; + } + + /* If there are simcalls associated with the synchro, then answer them */ + if (xbt_fifo_size(simcalls)) + SIMIX_execution_finish(this); +} diff --git a/src/simix/SynchroExec.hpp b/src/simix/SynchroExec.hpp index 7904cfe69d..d0abb299c2 100644 --- a/src/simix/SynchroExec.hpp +++ b/src/simix/SynchroExec.hpp @@ -17,6 +17,7 @@ namespace simix { public: void suspend(); void resume(); + void post() override; double remains(); sg_host_t host; /* The host where the execution takes place */ diff --git a/src/simix/SynchroIo.cpp b/src/simix/SynchroIo.cpp index e27e5f573b..dd2f2e240c 100644 --- a/src/simix/SynchroIo.cpp +++ b/src/simix/SynchroIo.cpp @@ -5,6 +5,8 @@ #include "src/simix/SynchroIo.hpp" #include "src/surf/surf_interface.hpp" +#include "src/simix/popping_private.h" +#include "src/simix/smx_private.h" void simgrid::simix::Io::suspend() { @@ -17,3 +19,51 @@ void simgrid::simix::Io::resume() if (surf_io) surf_io->resume(); } + +void simgrid::simix::Io::post() +{ + xbt_fifo_item_t i; + smx_simcall_t simcall; + + xbt_fifo_foreach(simcalls,i,simcall,smx_simcall_t) { + switch (simcall->call) { + case SIMCALL_FILE_OPEN: { + smx_file_t tmp = xbt_new(s_smx_file_t,1); + tmp->surf_file = surf_storage_action_get_file(surf_io); + simcall_file_open__set__result(simcall, tmp); + break; + } + case SIMCALL_FILE_CLOSE: + xbt_free(simcall_file_close__get__fd(simcall)); + simcall_file_close__set__result(simcall, 0); + break; + case SIMCALL_FILE_WRITE: + simcall_file_write__set__result(simcall, surf_io->getCost()); + break; + + case SIMCALL_FILE_READ: + simcall_file_read__set__result(simcall, surf_io->getCost()); + break; + + default: + break; + } + } + + switch (surf_io->getState()) { + + case simgrid::surf::Action::State::failed: + state = SIMIX_FAILED; + break; + + case simgrid::surf::Action::State::done: + state = SIMIX_DONE; + break; + + default: + THROW_IMPOSSIBLE; + break; + } + + SIMIX_io_finish(this); +} diff --git a/src/simix/SynchroIo.hpp b/src/simix/SynchroIo.hpp index 3d0aa2b2d3..afe6041cd9 100644 --- a/src/simix/SynchroIo.hpp +++ b/src/simix/SynchroIo.hpp @@ -16,6 +16,7 @@ namespace simix { public: void suspend(); void resume(); + void post() override; sg_host_t host; surf_action_t surf_io; diff --git a/src/simix/SynchroRaw.cpp b/src/simix/SynchroRaw.cpp index e73fe3d27c..872cf47b52 100644 --- a/src/simix/SynchroRaw.cpp +++ b/src/simix/SynchroRaw.cpp @@ -5,12 +5,28 @@ #include "src/simix/SynchroRaw.hpp" #include "src/surf/surf_interface.hpp" +#include "src/simix/smx_synchro_private.h" -void simgrid::simix::Raw::suspend() { +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro); + +void simgrid::simix::Raw::suspend() +{ /* The suspension of raw synchros is delayed to when the process is rescheduled. */ } -void simgrid::simix::Raw::resume() { +void simgrid::simix::Raw::resume() +{ /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at * the end of the synchro. */ } +void simgrid::simix::Raw::post() +{ + XBT_IN("(%p)",this); + if (sleep->getState() == simgrid::surf::Action::State::failed) + state = SIMIX_FAILED; + else if(sleep->getState() == simgrid::surf::Action::State::done) + state = SIMIX_SRC_TIMEOUT; + + SIMIX_synchro_finish(this); + XBT_OUT(); +} diff --git a/src/simix/SynchroRaw.hpp b/src/simix/SynchroRaw.hpp index c0a34442a7..25d4c2de32 100644 --- a/src/simix/SynchroRaw.hpp +++ b/src/simix/SynchroRaw.hpp @@ -17,6 +17,7 @@ namespace simix { public: void suspend(); void resume(); + void post() override; surf_action_t sleep; }; diff --git a/src/simix/SynchroSleep.cpp b/src/simix/SynchroSleep.cpp index 23959509e3..853dd316da 100644 --- a/src/simix/SynchroSleep.cpp +++ b/src/simix/SynchroSleep.cpp @@ -5,11 +5,56 @@ #include "src/simix/SynchroSleep.hpp" #include "src/surf/surf_interface.hpp" +#include "src/simix/popping_private.h" +#include "src/simix/smx_process_private.h" -void simgrid::simix::Sleep::suspend() { +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process); + +void simgrid::simix::Sleep::suspend() +{ surf_sleep->suspend(); } -void simgrid::simix::Sleep::resume() { +void simgrid::simix::Sleep::resume() +{ surf_sleep->resume(); } + +void simgrid::simix::Sleep::post() +{ + smx_simcall_t simcall; + e_smx_state_t state; + + while ((simcall = (smx_simcall_t) xbt_fifo_shift(simcalls))) { + + switch (surf_sleep->getState()){ + case simgrid::surf::Action::State::failed: + simcall->issuer->context->iwannadie = 1; + //SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed"); + state = SIMIX_SRC_HOST_FAILURE; + break; + + case simgrid::surf::Action::State::done: + state = SIMIX_DONE; + break; + + default: + THROW_IMPOSSIBLE; + break; + } + if (simcall->issuer->host->isOff()) { + simcall->issuer->context->iwannadie = 1; + } + simcall_process_sleep__set__result(simcall, state); + simcall->issuer->waiting_synchro = NULL; + 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); + } + } + + SIMIX_process_sleep_destroy(this); +} diff --git a/src/simix/SynchroSleep.hpp b/src/simix/SynchroSleep.hpp index 5a87136e40..b999526d17 100644 --- a/src/simix/SynchroSleep.hpp +++ b/src/simix/SynchroSleep.hpp @@ -16,6 +16,7 @@ namespace simix { public: void suspend(); void resume(); + void post() override; sg_host_t host; /* The host that is sleeping */ surf_action_t surf_sleep; /* The Surf sleeping action encapsulated */ diff --git a/src/simix/popping.cpp b/src/simix/popping.cpp index e8c8e5f3ff..631bc80f22 100644 --- a/src/simix/popping.cpp +++ b/src/simix/popping.cpp @@ -37,35 +37,7 @@ void SIMIX_simcall_answer(smx_simcall_t simcall) void SIMIX_simcall_exit(smx_synchro_t synchro) { - simgrid::simix::Exec *exec = dynamic_cast(synchro); - if (exec != nullptr) { - SIMIX_post_host_execute(exec); - return; - } - - simgrid::simix::Comm *comm = dynamic_cast(synchro); - if (comm != nullptr) { - SIMIX_post_comm(synchro); - return; - } - - simgrid::simix::Sleep *sleep = dynamic_cast(synchro); - if (sleep != nullptr) { - SIMIX_post_process_sleep(synchro); - return; - } - - simgrid::simix::Raw *raw = dynamic_cast(synchro); - if (raw != nullptr) { - SIMIX_post_synchro(synchro); - return; - } - - simgrid::simix::Io *io = dynamic_cast(synchro); - if (io != nullptr) { - SIMIX_post_io(synchro); - return; - } + synchro->post(); } void SIMIX_run_kernel(void* code) diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 79630cc59b..2fc7eb416c 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -16,8 +16,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts"); -static void SIMIX_execution_finish(simgrid::simix::Exec *exec); - /** * \brief Internal function to create a SIMIX host. * \param name name of the host to create @@ -438,32 +436,6 @@ void SIMIX_execution_finish(simgrid::simix::Exec *exec) exec->unref(); } - -void SIMIX_post_host_execute(simgrid::simix::Exec *exec) -{ - if (exec != nullptr && exec->host && /* FIMXE: handle resource failure for parallel tasks too */ - exec->host->isOff()) { - /* If the host running the synchro failed, notice it. This way, the asking - * process can be killed if it runs on that host itself */ - exec->state = SIMIX_FAILED; - } else if (exec->surf_exec->getState() == simgrid::surf::Action::State::failed) { - /* If the host running the synchro didn't fail, then the synchro was canceled */ - exec->state = SIMIX_CANCELED; - } else { - exec->state = SIMIX_DONE; - } - - if (exec != nullptr && exec->surf_exec) { - exec->surf_exec->unref(); - exec->surf_exec = NULL; - } - - /* If there are simcalls associated with the synchro, then answer them */ - if (xbt_fifo_size(exec->simcalls)) - SIMIX_execution_finish(exec); -} - - void SIMIX_set_category(smx_synchro_t synchro, const char *category) { if (synchro->state != SIMIX_RUNNING) return; diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 29812023aa..a96e5de954 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -52,8 +52,8 @@ XBT_PRIVATE void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t h XBT_PRIVATE void SIMIX_execution_suspend(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_execution_resume(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_execution_finish(simgrid::simix::Exec *exec); -XBT_PRIVATE void SIMIX_post_host_execute(simgrid::simix::Exec *exec); XBT_PRIVATE void SIMIX_set_category(smx_synchro_t synchro, const char *category); /* vm related stuff */ diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index 755f531da5..0834120291 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -255,52 +255,6 @@ const char* SIMIX_storage_get_host(smx_storage_t storage){ void SIMIX_post_io(smx_synchro_t synchro) { - xbt_fifo_item_t i; - smx_simcall_t simcall; - - simgrid::simix::Io *io = static_cast(synchro); - - xbt_fifo_foreach(synchro->simcalls,i,simcall,smx_simcall_t) { - switch (simcall->call) { - case SIMCALL_FILE_OPEN: { - smx_file_t tmp = xbt_new(s_smx_file_t,1); - tmp->surf_file = surf_storage_action_get_file(io->surf_io); - simcall_file_open__set__result(simcall, tmp); - break; - } - case SIMCALL_FILE_CLOSE: - xbt_free(simcall_file_close__get__fd(simcall)); - simcall_file_close__set__result(simcall, 0); - break; - case SIMCALL_FILE_WRITE: - simcall_file_write__set__result(simcall, io->surf_io->getCost()); - break; - - case SIMCALL_FILE_READ: - simcall_file_read__set__result(simcall, io->surf_io->getCost()); - break; - - default: - break; - } - } - - switch (io->surf_io->getState()) { - - case simgrid::surf::Action::State::failed: - synchro->state = SIMIX_FAILED; - break; - - case simgrid::surf::Action::State::done: - synchro->state = SIMIX_DONE; - break; - - default: - THROW_IMPOSSIBLE; - break; - } - - SIMIX_io_finish(synchro); } void SIMIX_io_destroy(smx_synchro_t synchro) diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index bec9527d1d..51a5ab74aa 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -693,44 +693,6 @@ void SIMIX_comm_finish(smx_synchro_t synchro) static_cast(synchro)->unref(); } -/** - * \brief This function is called when a Surf communication synchro is finished. - * \param synchro the corresponding Simix communication - */ -void SIMIX_post_comm(smx_synchro_t synchro) -{ - simgrid::simix::Comm *comm = static_cast(synchro); - - /* Update synchro state */ - if (comm->src_timeout && - comm->src_timeout->getState() == simgrid::surf::Action::State::done) - synchro->state = SIMIX_SRC_TIMEOUT; - else if (comm->dst_timeout && - comm->dst_timeout->getState() == simgrid::surf::Action::State::done) - synchro->state = SIMIX_DST_TIMEOUT; - else if (comm->src_timeout && - comm->src_timeout->getState() == simgrid::surf::Action::State::failed) - synchro->state = SIMIX_SRC_HOST_FAILURE; - else if (comm->dst_timeout && - comm->dst_timeout->getState() == simgrid::surf::Action::State::failed) - synchro->state = SIMIX_DST_HOST_FAILURE; - else if (comm->surf_comm && - comm->surf_comm->getState() == simgrid::surf::Action::State::failed) { - synchro->state = SIMIX_LINK_FAILURE; - } else - synchro->state = SIMIX_DONE; - - XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d", - comm, (int)comm->state, comm->src_proc, comm->dst_proc, comm->detached); - - /* destroy the surf actions associated with the Simix communication */ - comm->cleanupSurf(); - - /* if there are simcalls associated with the synchro, then answer them */ - if (xbt_fifo_size(synchro->simcalls)) - SIMIX_comm_finish(comm); -} - /******************************************************************************/ /* SIMIX_comm_copy_data callbacks */ /******************************************************************************/ diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 1451a8e1cf..55fc6990fa 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -35,7 +35,6 @@ XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t void *data, double rate); XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src, int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data); -XBT_PRIVATE void SIMIX_post_comm(smx_synchro_t synchro); #endif diff --git a/src/simix/smx_process.cpp b/src/simix/smx_process.cpp index 0d46b87398..ef55883fa2 100644 --- a/src/simix/smx_process.cpp +++ b/src/simix/smx_process.cpp @@ -859,46 +859,6 @@ smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration) return synchro; } -void SIMIX_post_process_sleep(smx_synchro_t synchro) -{ - smx_simcall_t simcall; - e_smx_state_t state; - simgrid::simix::Sleep *sleep = static_cast(synchro); - - while ((simcall = (smx_simcall_t) xbt_fifo_shift(synchro->simcalls))) { - - switch (sleep->surf_sleep->getState()){ - case simgrid::surf::Action::State::failed: - simcall->issuer->context->iwannadie = 1; - //SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed"); - state = SIMIX_SRC_HOST_FAILURE; - break; - - case simgrid::surf::Action::State::done: - state = SIMIX_DONE; - break; - - default: - THROW_IMPOSSIBLE; - break; - } - if (simcall->issuer->host->isOff()) { - simcall->issuer->context->iwannadie = 1; - } - simcall_process_sleep__set__result(simcall, state); - simcall->issuer->waiting_synchro = NULL; - 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); - } - } - - SIMIX_process_sleep_destroy(synchro); -} - void SIMIX_process_sleep_destroy(smx_synchro_t synchro) { XBT_DEBUG("Destroy synchro %p", synchro); diff --git a/src/simix/smx_process_private.h b/src/simix/smx_process_private.h index c721913b38..89a28c3dc0 100644 --- a/src/simix/smx_process_private.h +++ b/src/simix/smx_process_private.h @@ -101,7 +101,6 @@ XBT_PRIVATE int SIMIX_process_is_suspended(smx_process_t process); XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties(smx_process_t process); XBT_PRIVATE smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout); XBT_PRIVATE smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration); -XBT_PRIVATE void SIMIX_post_process_sleep(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart); diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index afb57832b8..442695e03c 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -14,7 +14,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_synchro, simix, "SIMIX Synchronization (mutex, semaphores and conditions)"); static smx_synchro_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout); -static void SIMIX_synchro_finish(smx_synchro_t synchro); static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout, smx_process_t issuer, smx_simcall_t simcall); static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer, @@ -74,20 +73,7 @@ void SIMIX_synchro_destroy(smx_synchro_t synchro) delete raw; } -void SIMIX_post_synchro(smx_synchro_t synchro) -{ - XBT_IN("(%p)",synchro); - simgrid::simix::Raw *raw = static_cast(synchro); - if (raw->sleep->getState() == simgrid::surf::Action::State::failed) - raw->state = SIMIX_FAILED; - else if(raw->sleep->getState() == simgrid::surf::Action::State::done) - raw->state = SIMIX_SRC_TIMEOUT; - - SIMIX_synchro_finish(raw); - XBT_OUT(); -} - -static void SIMIX_synchro_finish(smx_synchro_t synchro) +void SIMIX_synchro_finish(smx_synchro_t synchro) { XBT_IN("(%p)",synchro); smx_simcall_t simcall = (smx_simcall_t) xbt_fifo_shift(synchro->simcalls); diff --git a/src/simix/smx_synchro_private.h b/src/simix/smx_synchro_private.h index 9cf259203a..c8ea1f64f4 100644 --- a/src/simix/smx_synchro_private.h +++ b/src/simix/smx_synchro_private.h @@ -10,6 +10,7 @@ #include "xbt/base.h" #include "xbt/swag.h" #include "xbt/xbt_os_thread.h" +#include "src/simix/popping_private.h" typedef struct s_smx_mutex { unsigned int locked; @@ -30,6 +31,7 @@ typedef struct s_smx_sem { XBT_PRIVATE void SIMIX_post_synchro(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t simcall); XBT_PRIVATE void SIMIX_synchro_destroy(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_synchro_finish(smx_synchro_t synchro); XBT_PRIVATE smx_mutex_t SIMIX_mutex_init(void); XBT_PRIVATE int SIMIX_mutex_trylock(smx_mutex_t mutex, smx_process_t issuer); -- 2.20.1