Package org.mpi_sws.jmc.strategies
Class TrackActiveTasksStrategy.TrackLocks
java.lang.Object
org.mpi_sws.jmc.strategies.TrackActiveTasksStrategy.TrackLocks
- All Implemented Interfaces:
TrackActiveTasksStrategy.Tracker
- Enclosing class:
TrackActiveTasksStrategy
public static class TrackActiveTasksStrategy.TrackLocks
extends Object
implements TrackActiveTasksStrategy.Tracker
Tracks the locks acquired and released events of tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()Resets the tracker.updateEvent(JmcRuntimeEvent event) Updates based on lock acquire and release events.
-
Constructor Details
-
TrackLocks
public TrackLocks()Constructs a new TrackLocks object.
-
-
Method Details
-
updateEvent
Updates based on lock acquire and release events.For every acquire event, if the lock is already acquired, the task is made to wait. Tracked in
waitingTasks.If it is not yet acquired, it is put in
wantingTasksand retained in active tasks.For every release event, the corresponding waiting tasks are marked as active.
- Specified by:
updateEventin interfaceTrackActiveTasksStrategy.Tracker- Parameters:
event- the event to update- Returns:
- the set of active tasks
-
reset
public void reset()Description copied from interface:TrackActiveTasksStrategy.TrackerResets the tracker.- Specified by:
resetin interfaceTrackActiveTasksStrategy.Tracker
-