Class SharedStateMutationOutsideLockOrError

java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.SharedStateMutationOutsideLockOrError
All Implemented Interfaces:
Consumer<EK9Parser.AssignmentStatementContext>

final class SharedStateMutationOutsideLockOrError extends TypedSymbolAccess implements Consumer<EK9Parser.AssignmentStatementContext>
The principal data-race check (slice 1, step 7): every mutation of shared state inside a function/method marked CONCURRENT_ENTRY_POINT must occur inside a MutexLock.enter(...) callback.

"Shared state" in this foundation pass means a field of the enclosing aggregate โ€” a write to this.<field> (or the bare-identifier shorthand) from inside a Component method, dynamic-class method, or other method that is transitively reachable from an HTTP service operation, TCP/Signals handler, or async stream stage. Subsequent passes will widen the rule to non-pure calls on shared receivers and capture-write through closures.

Exemptions:

  • MutexKey body โ€” the lambda passed to enter()/tryEnter(). Writes here are by definition inside the lock.
  • Constructor body โ€” never carries the marker (Step 6/6b skip constructors). The object hasn't escaped yet so its fields aren't shared; E08250 forbids early publication.

Part of EK9's compile-time data-race detection (slice 1, model rule ยง3.5). Error E08251 SHARED_STATE_MUTATION_OUTSIDE_LOCK.