From 5e1ed48b14810cc0149945b7ca0a5fbac6ef2eb1 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Thu, 3 Nov 2022 22:59:01 -0700 Subject: [PATCH] Editorial: Simplify Atomics operations (#2948) --- spec.html | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/spec.html b/spec.html index 79e1ade215..94a9ce00be 100644 --- a/spec.html +++ b/spec.html @@ -42020,13 +42020,11 @@

1. Assert: The surrounding agent is in the critical section for _WL_. - 1. Let _L_ be a new empty List. 1. Let _S_ be a reference to the list of waiters in _WL_. - 1. Repeat, while _c_ > 0 and _S_ is not empty, - 1. Let _W_ be the first waiter in _S_. - 1. Append _W_ to _L_. - 1. Remove _W_ from _S_. - 1. If _c_ is finite, set _c_ to _c_ - 1. + 1. Let _len_ be the number of elements in _S_. + 1. Let _n_ be min(_c_, _len_). + 1. Let _L_ be a List whose elements are the first _n_ elements of _S_. + 1. Remove the first _n_ elements of _S_. 1. Return _L_. @@ -42356,15 +42354,12 @@

Atomics.notify ( _typedArray_, _index_, _count_ )

1. Let _block_ be _buffer_.[[ArrayBufferData]]. 1. If IsSharedArrayBuffer(_buffer_) is *false*, return *+0*𝔽. 1. Let _WL_ be GetWaiterList(_block_, _indexedPosition_). - 1. Let _n_ be 0. 1. Perform EnterCriticalSection(_WL_). 1. Let _S_ be RemoveWaiters(_WL_, _c_). - 1. Repeat, while _S_ is not empty, - 1. Let _W_ be the first agent in _S_. - 1. Remove _W_ from the front of _S_. + 1. For each element _W_ of _S_, do 1. Perform NotifyWaiter(_WL_, _W_). - 1. Set _n_ to _n_ + 1. 1. Perform LeaveCriticalSection(_WL_). + 1. Let _n_ be the number of elements in _S_. 1. Return 𝔽(_n_).