diff --git a/spec.html b/spec.html index b41fe83840..c345fe85b4 100644 --- a/spec.html +++ b/spec.html @@ -36057,9 +36057,10 @@

ValidateAtomicAccess ( _typedArray_, _requestIndex_ )

GetWaiterList ( _block_, _i_ )

-

A WaiterList is a semantic object that contains an ordered list of those agents that are waiting on a location (_block_, _i_) in shared memory; _block_ is a Shared Data Block and _i_ a byte offset into the memory of _block_.

+

A WaiterList is a semantic object that contains an ordered list of those agents that are waiting on a location (_block_, _i_) in shared memory; _block_ is a Shared Data Block and _i_ a byte offset into the memory of _block_. A WaiterList object also optionally contains a Synchronize event denoting the previous leaving of its critical section.

+

Initially a WaiterList object has an empty list and no Synchronize event.

The agent cluster has a store of WaiterList objects; the store is indexed by (_block_, _i_). WaiterLists are agent-independent: a lookup in the store of WaiterLists by (_block_, _i_) will result in the same WaiterList object in any agent in the agent cluster.

-

Operations on a WaiterList—adding and removing waiting agents, traversing the list of agents, suspending and notifying agents on the list—may only be performed by agents that have entered the WaiterList's critical section.

+

Operations on a WaiterList—adding and removing waiting agents, traversing the list of agents, suspending and notifying agents on the list, setting and retrieving the Synchronize event—may only be performed by agents that have entered the WaiterList's critical section.

The abstract operation GetWaiterList takes two arguments, a Shared Data Block _block_ and a nonnegative integer _i_. It performs the following steps:

1. Assert: _block_ is a Shared Data Block. @@ -36075,6 +36076,15 @@

EnterCriticalSection ( _WL_ )

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 _WL_ has a Synchronize event, then + 1. NOTE: A _WL_ whose critical section has been entered at least once has a Synchronize event set by LeaveCriticalSection. + 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 _enterEvent_ be a new Synchronize event. + 1. Append _enterEvent_ to _entererEventList_. + 1. Let _leaveEvent_ be the Synchronize event in _WL_. + 1. Append (_leaveEvent_, _enterEvent_) to _eventRecords_.[[AgentSynchronizesWith]].
@@ -36083,6 +36093,12 @@

LeaveCriticalSection ( _WL_ )

The abstract operation LeaveCriticalSection takes one argument, a WaiterList _WL_. It performs the following steps:

1. Assert: The calling agent is in the critical section for _WL_. + 1. Let _execution_ be the [[CandidateExecution]] field of the calling surrounding's Agent Record. + 1. Let _eventsRecord_ be the Agent Events Record in _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). + 1. Let _leaverEventList_ be _eventsRecord_.[[EventList]]. + 1. Let _leaveEvent_ be a new Synchronize event. + 1. Append _leaveEvent_ to _leaverEventList_. + 1. Set the Synchronize event in _WL_ to _leaveEvent_. 1. Leave the critical section for _WL_. @@ -36144,15 +36160,6 @@

NotifyWaiter ( _WL_, _W_ )

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_.