Module StarvationDomain.CriticalPair

A CriticalPairElement equipped with a call stack. The intuition is that if we have a critical pair `(locks, event)` in the summary of a method then there is a trace of that method where `event` occurs, and right before it occurs the locks held are exactly `locks` (no over/under approximation). We call it "critical" because the information here alone determines deadlock conditions.

type t = private {
  1. elem : CriticalPairElement.t;
  2. loc : IBase.Location.t;
  3. trace : Absint.CallSite.t list;
}
include IStdlib.PrettyPrintable.PrintableOrderedType with type t := t
include IStdlib.IStd.Caml.Set.OrderedType with type t := t
val compare : t -> t -> int
include IStdlib.PrettyPrintable.PrintableType with type t := t
val pp : IStdlib.PrettyPrintable.F.formatter -> t -> unit
val get_loc : t -> IBase.Location.t

outermost callsite location

val get_earliest_lock_or_call_loc : procname:IR.Procname.t -> t -> IBase.Location.t

outermost callsite location OR lock acquisition

val may_deadlock : IR.Tenv.t -> lhs:t -> lhs_lock:Lock.t -> rhs:t -> Lock.t option

if two pairs can run in parallel and satisfy the conditions for deadlock, when lhs_lock of lhs is involved return the lock involved from rhs, as LockAcquire may involve more than one

val make_trace : ?header:string -> ?include_acquisitions:bool -> IR.Procname.t -> t -> Absint.Errlog.loc_trace
val is_uithread : t -> bool

is pair about an event on the UI thread

val can_run_in_parallel : t -> t -> bool

can two pairs describe events on two threads that can run in parallel

val with_callsite : t -> Absint.CallSite.t -> t
val apply_caller_thread : ThreadDomain.t -> t -> t option