Skip to content

Commit

Permalink
Normative: Make the Atomics critical section imply synchronizes-with (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
syg committed Sep 7, 2019
1 parent fcae34e commit cff7e74
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -36075,6 +36075,16 @@ <h1>EnterCriticalSection ( _WL_ )</h1>
<emu-alg>
1. Assert: The calling agent is not in the critical section for any WaiterList.
1. Wait until no agent is in the critical section for _WL_, then enter the critical section for _WL_ (without allowing any other agent to enter).
1. If there was an agent in the critical section for _WL_ prior to entry, then
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
1. Let _eventsRecord_ be the Agent Events Record in _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
1. Let _entererEventList_ be _eventsRecord_.[[EventList]].
1. Let _L_ be the Agent Signifier of the agent in the critical section immediately preceding the surrounding agent's entry.
1. Let _leaverEventList_ be the [[EventList]] field of the element in _execution_.[[EventRecords]] whose [[AgentSignifier]] is _L_.
1. Let _enterEvent_ and _leaveEvent_ be new Synchronize events.
1. Append _enterEvent_ to _entererEventList_.
1. Append _leaveEvent_ to _leaverEventList_.
1. Append (_leaveEvent_, _enterEvent_) to _eventRecords_.[[AgentSynchronizesWith]].
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -36144,15 +36154,6 @@ <h1>NotifyWaiter ( _WL_, _W_ )</h1>
<emu-alg>
1. Assert: The calling agent is in the critical section for _WL_.
1. Assert: _W_ is on the list of waiters in _WL_.
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
1. Let _eventsRecord_ be the Agent Events Record in _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
1. Let _agentSynchronizesWith_ be _eventsRecord_.[[AgentSynchronizesWith]].
1. Let _notifierEventList_ be _eventsRecord_.[[EventList]].
1. Let _waiterEventList_ be the [[EventList]] field of the element in _execution_.[[EventsRecords]] whose [[AgentSignifier]] is _W_.
1. Let _notifyEvent_ and _waitEvent_ be new Synchronize events.
1. Append _notifyEvent_ to _notifierEventList_.
1. Append _waitEvent_ to _waiterEventList_.
1. Append (_notifyEvent_, _waitEvent_) to _agentSynchronizesWith_.
1. Notify the agent _W_.
</emu-alg>
<emu-note>
Expand Down

0 comments on commit cff7e74

Please sign in to comment.