-XBT_ATTRIB_DEPRECATED_v325("Please manifest if you actually need this function")
- XBT_PUBLIC const std::vector<smx_actor_t>& process_get_runnable();
-
-// What's executed as SIMIX actor code:
-typedef std::function<void()> ActorCode;
-
-// Create an ActorCode based on a std::string
-typedef std::function<ActorCode(std::vector<std::string> args)> ActorCodeFactory;
-
-XBT_PUBLIC void register_function(const std::string& name, ActorCodeFactory factory);
-
-typedef std::pair<double, Timer*> TimerQelt;
-static boost::heap::fibonacci_heap<TimerQelt, boost::heap::compare<xbt::HeapComparator<TimerQelt>>> simix_timers;
-
-/** @brief Timer datatype */
-class Timer {
- double date = 0.0;
-
-public:
- decltype(simix_timers)::handle_type handle_;
-
- Timer(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
+/** Execute some code (that does not return immediately) in kernel context
+ *
+ * This is very similar to simcall() right above, but the calling actor will not get rescheduled until
+ * actor->simcall_answer() is called explicitly.
+ *
+ * This is meant for blocking actions. For example, locking a mutex is a blocking simcall.
+ * First it's a simcall because that's obviously a modification of the world. Then, that's a blocking simcall because if
+ * the mutex happens not to be free, the actor is added to a queue of actors in the mutex. Every mutex->unlock() takes
+ * the first actor from the queue, mark it as current owner of the mutex and call actor->simcall_answer() to mark that
+ * this mutex is now unblocked and ready to run again. If the mutex is initially free, the calling actor is unblocked
+ * right away with actor->simcall_answer() once the mutex is marked as locked.
+ *
+ * If your code never calls actor->simcall_answer() itself, the actor will never return from its simcall.
+ *
+ * The return value is obtained from observer->get_result() if it exists. Otherwise void is returned.
+ */
+template <class F> void simcall_blocking(F&& code, SimcallObserver* observer = nullptr)
+{
+ xbt_assert(not SIMIX_is_maestro(), "Cannot execute blocking call in kernel mode");