Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make SIMIX_context_runall() trivial so that its content can be inlined easily
[simgrid.git] / src / kernel / context / Context.cpp
index 29393ea..a40fa0c 100644 (file)
 #include "src/kernel/context/Context.hpp"
 #include "src/simix/smx_private.h"
 
-void SIMIX_process_set_cleanup_function(
-  smx_process_t process, void_pfn_smxprocess_t cleanup)
-{
-  process->context->set_cleanup(cleanup);
-}
-
 /**
  * @brief creates a new context for a user level process
  * @param code a main function
@@ -33,8 +27,7 @@ smx_context_t SIMIX_context_new(
   void_pfn_smxprocess_t cleanup_func,
   smx_process_t simix_process)
 {
-  if (!simix_global)
-    xbt_die("simix is not initialized, please call MSG_init first");
+  xbt_assert(simix_global, "simix is not initialized, please call MSG_init first");
   return simix_global->context_factory->create_context(
     std::move(code), cleanup_func, simix_process);
 }
@@ -110,8 +103,7 @@ AttachContext::~AttachContext()
 /** @brief Executes all the processes to run (in parallel if possible). */
 void SIMIX_context_runall(void)
 {
-  if (!xbt_dynar_is_empty(simix_global->process_to_run))
-    simix_global->context_factory->run_all();
+  simix_global->context_factory->run_all();
 }
 
 /** @brief returns the current running context */