@Stage("Locks") public String debugContextsAndLocks() { String message = ""; message += "Contexts locked on this segment:\n"; for (LocksInterface cxt = rootContextLockedOnThisSegment; cxt != null; cxt = cxt.nextNode()) { message += cxt.debugLocksState() + "\n"; } message += "Current thread contexts:\n"; for (int i = 0, size = chaining.contextChain.size(); i < size; i++) { LocksInterface cxt = chaining.contextAtIndexInChain(i); message += cxt.debugLocksState() + "\n"; } return message; }
@Stage("Locks") boolean tryFindInitLocksOfThisSegment(int index) { LocksInterface c = chaining.contextAtIndexInChain(index); if (c.segmentHeaderInit() && c.segmentHeaderAddress() == segmentHeaderAddress && c.locksInit()) { LocksInterface root = c.rootContextLockedOnThisSegment(); this.rootContextLockedOnThisSegment = root; root.setNestedContextsLockedOnSameSegment(true); this.nestedContextsLockedOnSameSegment = true; this.contextModCount = root.latestSameThreadSegmentModCount(); linkToSegmentContextsChain(); return true; } else { return false; } }