Skip to content

Commit

Permalink
Use RequireInternalSlot
Browse files Browse the repository at this point in the history
  • Loading branch information
syg committed Sep 18, 2024
1 parent df7d0c8 commit 5de3d70
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1639,11 +1639,9 @@ <h1>Atomics.Mutex.lock ( _mutex_ [ , _unlockToken_ [ , _timeout_ ] ] )</h1>
<p>This function puts the surrounding agent in a wait queue and suspends it until the mutex is unlocked or until the wait times out, returning a String differentiating those cases.</p>
<p>It performs the following steps when called:</p>
<emu-alg>
1. If _mutex_ is not an Object, throw a *TypeError* exception.
1. If _mutex_ does not have a [[MutexWaiterList]] internal slot, throw a *TypeError* exception.
1. Perform ? RequireInternalSlot(_mutex_, [[MutexWaiterList]]).
1. If _unlockToken_ not *undefined*, then
1. If _unlockToken_ is not an Object, throw a *TypeError* exception.
1. If _unlockToken_ does not have a [[LockedMutex]] internal slot, throw a *TypeError* exception.
1. Perform ? RequireInternalSlot(_unlockToken_, [[LockedMutex]]).
1. If _unlockToken_.[[LockedMutex]] is not ~empty~, throw a *TypeError* exception.
1. If _timeout_ is *undefined*, set _timeout_ to *+∞*<sub>𝔽</sub>.
1. If _timeout_ is not a Number, throw a *TypeError* exception.
Expand All @@ -1662,11 +1660,9 @@ <h1>Atomics.Mutex.lock ( _mutex_ [ , _unlockToken_ [ , _timeout_ ] ] )</h1>
<h1>Atomics.Mutex.tryLock ( _mutex_ [ , _unlockToken_ ] )</h1>
<p>It performs the following steps when called:</p>
<emu-alg>
1. If _mutex_ is not an Object, throw a *TypeError* exception.
1. If _mutex_ does not have a [[MutexWaiterList]] internal slot, throw a *TypeError* exception.
1. Perform ? RequireInternalSlot(_mutex_, [[MutexWaiterList]]).
1. If _unlockToken_ not *undefined*, then
1. If _unlockToken_ is not an Object, throw a *TypeError* exception.
1. If _unlockToken_ does not have a [[LockedMutex]] internal slot, throw a *TypeError* exception.
1. Perform ? RequireInternalSlot(_unlockToken_, [[LockedMutex]]).
1. If _unlockToken_.[[LockedMutex]] is not ~empty~, throw a *TypeError* exception.
1. Let _WL_ be _mutex_.[[MutexWaiterList]].
1. Perform EnterCriticalSection(_WL_).
Expand All @@ -1684,8 +1680,7 @@ <h1>Atomics.Mutex.tryLock ( _mutex_ [ , _unlockToken_ ] )</h1>
<h1>Atomics.Mutex.withLock ( _mutex_, _callback_ [ , _thisArg_ ] )</h1>
<p>It performs the following steps when called:</p>
<emu-alg>
1. If _mutex_ is not an Object, throw a *TypeError* exception.
1. If _mutex_ does not have a [[MutexWaiterList]] internal slot, throw a *TypeError* exception.
1. Perform ? RequireInternalSlot(_mutex_, [[MutexWaiterList]]).
1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception.
1. If AgentCanSuspend() is *false*, throw a *TypeError* exception.
1. Let _lockResult_ be LockMutex(_mutex_, +∞).
Expand Down Expand Up @@ -1721,8 +1716,7 @@ <h1>%MutexUnlockTokenPrototype%.unlock ( )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. Let _token_ be the *this* value.
1. If _token_ is not an Object, throw a *TypeError* exception.
1. If _token_ does not have a [[LockedMutex]] internal slot, throw a *TypeError* exception.
1. Perform ? RequireInternalSlot(_token_, [[LockedMutex]]).
1. Let _mutex_ be _token_.[[LockedMutex]].
1. If _mutex_ is not ~empty~, then
1. Set _token_.[[LockedMutex]] to ~empty~.
Expand Down

0 comments on commit 5de3d70

Please sign in to comment.