Record Class CrossThreadEdge

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.lockanalysis.CrossThreadEdge
Record Components:
caller - the function/method that contains the thread-spawning call. Navigation target for "where the dispatch happens."
handler - the function passed as the handler argument; runs on a different thread when the framework invokes it.
callLocation - source token of the thread-spawning call expression (e.g. the .accept(handler) call site). Used by DeadlockChain to render the StepKind.CROSS_THREAD_BOUNDARY step.

public record CrossThreadEdge(ISymbol caller, ISymbol handler, IToken callLocation) extends Record
A synthetic call-graph edge representing thread-boundary-crossing dispatch — passing a function as the handler argument to TCP.accept, Signals.register, or as a stage in cat ... | async.

The standard CallGraph captures synchronous call relationships only: at a tcpServer.accept(handler) site, the call graph records caller → TCP.accept. The framework's subsequent invocation of handler on a different thread isn't a synchronous call and isn't captured.

Phase C.1 walks the AST and identifies these dispatch sites, recording one CrossThreadEdge per (caller, handler) pair. Phase C.2's mayEnter composition consumes both the regular call graph and these synthetic edges, classifying any path containing a cross-thread edge as CROSS_THREAD per EK9_CONCURRENCY_MODEL.md §5.2.

  • Constructor Details

    • CrossThreadEdge

      public CrossThreadEdge(ISymbol caller, ISymbol handler, IToken callLocation)
      Creates an instance of a CrossThreadEdge record class.
      Parameters:
      caller - the value for the caller record component
      handler - the value for the handler record component
      callLocation - the value for the callLocation record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • caller

      public ISymbol caller()
      Returns the value of the caller record component.
      Returns:
      the value of the caller record component
    • handler

      public ISymbol handler()
      Returns the value of the handler record component.
      Returns:
      the value of the handler record component
    • callLocation

      public IToken callLocation()
      Returns the value of the callLocation record component.
      Returns:
      the value of the callLocation record component