67 const std::vector<std::uint32_t> &available
DeadlockDetector & operator=(const DeadlockDetector &)=delete
DeadlockDetector(DeadlockDetector &&) noexcept
DeadlockDetector(const DeadlockDetector &)=delete
bool hasDeadlock() const
Returns true if the current wait-for graph has a cycle.
void onAcquire(ProcessId pid, ResourceId resource)
Records successful acquisition of a resource by a process.
std::vector< ProcessId > getDeadlockedProcesses() const
Returns process IDs involved in deadlock cycles.
void onWait(ProcessId pid, ResourceId resource)
Records waiting on a resource and updates wait-for graph.
void onRelease(ProcessId pid, ResourceId resource)
Records release of a resource by a process.
bool isSafeState(const std::vector< ResourceAllocation > ¤t, const std::vector< ResourceAllocation > &maximum, const std::vector< std::uint32_t > &available) const
Banker's algorithm safety check.
std::unique_ptr< Impl > impl_
std::uint32_t ProcessId
Unique identifier for a process.
std::uint32_t ResourceId
Unique identifier for a synchronization resource (mutex, semaphore, etc.).
constexpr ProcessId INVALID_PID
Sentinel value indicating an invalid/unassigned process ID.
Per-process resource vector used by Banker's safety check.
ProcessId pid
Process identifier for this allocation row.
std::vector< std::uint32_t > resources
Resource vector indexed by resource type.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...