Skip to content

Commit

Permalink
Editorial: Simplify Atomics operations (#2948)
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 authored and ljharb committed Nov 4, 2022
1 parent 2cf3528 commit 5e1ed48
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -42020,13 +42020,11 @@ <h1>
</dl>
<emu-alg>
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_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -42356,15 +42354,12 @@ <h1>Atomics.notify ( _typedArray_, _index_, _count_ )</h1>
1. Let _block_ be _buffer_.[[ArrayBufferData]].
1. If IsSharedArrayBuffer(_buffer_) is *false*, return *+0*<sub>𝔽</sub>.
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_).
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 5e1ed48

Please sign in to comment.