Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove smx_global.cpp
[simgrid.git] / src / kernel / actor / ActorImpl.cpp
index 93549a5e87ead5e4154b64370cf1b209a4114570..dbc2a553be3eaa5c66a5bcd3a063c37c5f1a6e94 100644 (file)
@@ -526,8 +526,7 @@ void create_maestro(const std::function<void()>& code)
 } // namespace kernel
 } // namespace simgrid
 
-/* needs to be public and without simcall because it is called
-   by exceptions and logging events */
+/* needs to be public and without simcall because it is called by exceptions and logging events */
 const char* SIMIX_process_self_get_name()
 {
   return SIMIX_is_maestro() ? "maestro" : simgrid::kernel::actor::ActorImpl::self()->get_cname();
@@ -538,3 +537,9 @@ smx_actor_t SIMIX_process_from_PID(aid_t pid) // XBT_ATTRIB_DEPRECATD_v331
 {
   return simgrid::kernel::actor::ActorImpl::by_pid(pid);
 }
+
+int SIMIX_is_maestro()
+{
+  const auto* self = simgrid::kernel::actor::ActorImpl::self();
+  return self == nullptr || simgrid::kernel::EngineImpl::get_instance()->is_maestro(self);
+}