Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Actor: make the refcount observable, and improve debug messages
[simgrid.git] / include / simgrid / s4u / Actor.hpp
index 8e48a17..3b847f2 100644 (file)
@@ -6,15 +6,18 @@
 #ifndef SIMGRID_S4U_ACTOR_HPP
 #define SIMGRID_S4U_ACTOR_HPP
 
-#include <functional>
-#include <map> // deprecated wrappers
+#include <simgrid/forward.h>
+
 #include <simgrid/chrono.hpp>
-#include <unordered_map>
 #include <xbt/Extendable.hpp>
 #include <xbt/functional.hpp>
 #include <xbt/signal.hpp>
 #include <xbt/string.hpp>
 
+#include <functional>
+#include <map> // deprecated wrappers
+#include <unordered_map>
+
 namespace simgrid {
 namespace s4u {
 
@@ -139,6 +142,7 @@ public:
   // ***** Reference count *****
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Actor * actor);
   friend XBT_PUBLIC void intrusive_ptr_release(Actor * actor);
+  int get_refcount();
 
   // ***** Actor creation *****
   /** Retrieve a reference to myself */
@@ -308,10 +312,10 @@ namespace this_actor {
 
 XBT_PUBLIC bool is_maestro();
 
-/** Block the current actor sleeping for that amount of seconds (may throw hostFailure) */
+/** Block the current actor sleeping for that amount of seconds */
 XBT_PUBLIC void sleep_for(double duration);
-/** Block the current actor sleeping until the specified timestamp (may throw hostFailure) */
-XBT_PUBLIC void sleep_until(double timeout);
+/** Block the current actor sleeping until the specified timestamp */
+XBT_PUBLIC void sleep_until(double wakeup_time);
 
 template <class Rep, class Period> inline void sleep_for(std::chrono::duration<Rep, Period> duration)
 {
@@ -319,9 +323,9 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
   this_actor::sleep_for(seconds.count());
 }
 
-template <class Duration> inline void sleep_until(const SimulationTimePoint<Duration>& timeout_time)
+template <class Duration> inline void sleep_until(const SimulationTimePoint<Duration>& wakeup_time)
 {
-  auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(timeout_time);
+  auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(wakeup_time);
   this_actor::sleep_until(timeout_native.time_since_epoch().count());
 }
 
@@ -461,9 +465,6 @@ XBT_PUBLIC void migrate(Host* new_host);
 #ifndef DOXYGEN
 XBT_ATTRIB_DEPRECATED_v325("Please use std::function<void(bool)> for first parameter.") XBT_PUBLIC
     void on_exit(const std::function<void(int, void*)>& fun, void* data);
-
-/** @deprecated See this_actor::exit() */
-XBT_ATTRIB_DEPRECATED_v324("Please use this_actor::exit()") XBT_PUBLIC void kill();
 #endif
 }