Record Class MutexKeyBody

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.lockanalysis.MutexKeyBody
Record Components:
stableId - wire-form identifier.
keyFunction - the dynamic function symbol (the lambda itself). Navigation target for "jump to the MutexKey body."
declarationLocation - source token of the (captures) is MutexKey of T as function declaration.
enclosingFunction - the function/method that syntactically contains the lambda. Navigation target for "jump to the enclosing function."
outerLockIdentityId - FK into LockAnalysis.identitiesById() — the lock this key body wraps.

public record MutexKeyBody(String stableId, ISymbol keyFunction, IToken declarationLocation, ISymbol enclosingFunction, String outerLockIdentityId) extends Record
A MutexKey dynamic-function body — the lambda passed as the argument to enter(...) or tryEnter(...).

Each MutexKey body protects the lock identified by outerLockIdentityId; its body executes with that lock held on the calling thread.

  • Constructor Details

    • MutexKeyBody

      public MutexKeyBody(String stableId, ISymbol keyFunction, IToken declarationLocation, ISymbol enclosingFunction, String outerLockIdentityId)
      Creates an instance of a MutexKeyBody record class.
      Parameters:
      stableId - the value for the stableId record component
      keyFunction - the value for the keyFunction record component
      declarationLocation - the value for the declarationLocation record component
      enclosingFunction - the value for the enclosingFunction record component
      outerLockIdentityId - the value for the outerLockIdentityId 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.
    • stableId

      public String stableId()
      Returns the value of the stableId record component.
      Returns:
      the value of the stableId record component
    • keyFunction

      public ISymbol keyFunction()
      Returns the value of the keyFunction record component.
      Returns:
      the value of the keyFunction record component
    • declarationLocation

      public IToken declarationLocation()
      Returns the value of the declarationLocation record component.
      Returns:
      the value of the declarationLocation record component
    • enclosingFunction

      public ISymbol enclosingFunction()
      Returns the value of the enclosingFunction record component.
      Returns:
      the value of the enclosingFunction record component
    • outerLockIdentityId

      public String outerLockIdentityId()
      Returns the value of the outerLockIdentityId record component.
      Returns:
      the value of the outerLockIdentityId record component