40 #ifndef __SIM_DRAIN_HH__ 41 #define __SIM_DRAIN_HH__ 137 void preCheckpointRestore();
149 void signalDrainDone();
153 void unregisterDrainable(
Drainable *obj);
166 size_t drainableCount()
const;
268 switch (_drainState) {
275 _drainManager.signalDrainDone();
302 void dmDrainResume();
DrainManager & _drainManager
Convenience reference to the drain manager.
DrainState
Object drain/handover states.
DrainState state() const
Get the simulators global drain state.
Buffers drained, ready for serialization/handover.
DrainState drainState() const
Return the current drain state of an object.
void signalDrainDone() const
Signal that an object is drained.
Interface for objects that might require draining before checkpointing.
std::atomic_uint _count
Number of objects still draining.
This class coordinates draining of a System.
std::vector< Drainable * > _allDrainable
Set of all drainable objects.
bool isDrained() const
Check if the system is drained.
static DrainManager _instance
Singleton instance of the drain manager.
Draining buffers pending serialization/handover.
std::mutex globalLock
Lock protecting the set of drainable objects.
virtual void notifyFork()
Notify a child process of a fork.
static DrainManager & instance()
Get the singleton DrainManager instance.
virtual void drainResume()
Resume execution after a successful drain.
DrainState _state
Global simulator drain state.
DrainState _drainState
Current drain state of the object.