Skip to content

Commit

Permalink
Add a realm to HostEnqueueCrossAgentJob; make timeout non-negative; f…
Browse files Browse the repository at this point in the history
…ix formatting

The realm is requested on the HTML side to make queuing a task easier.
  • Loading branch information
syg committed May 5, 2023
1 parent 1dae263 commit e9c80e3
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -42636,7 +42636,8 @@ <h1>
1. Assert: AgentSignifier() is _agentSignifier_.
1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _resolution_ »).
1. Return ~unused~.
1. Perform HostEnqueueCrossAgentJob(_resolveJob_, _agentSignifier_).
1. Let _realmInTargetAgent_ be ! GetFunctionRealm(_promiseCapability_.[[Resolve]]).
1. Perform HostEnqueueCrossAgentJob(_resolveJob_, _agentSignifier_, _realmInTargetAgent_).
1. Return ~unused~.
</emu-alg>
<p>An implementation of HostEnqueueResolveInAgentJob must schedule _resolveJob_ in the agent signified by _agentSignifier_. The host may delay performing _resolveJob_ in the agent signified by _agentSignifier_, e.g. for resource management reasons, but it eventually must be performed for forward progress.</p>
Expand All @@ -42648,11 +42649,12 @@ <h1>
HostEnqueueCrossAgentJob (
_job_: a Job Abstract Closure,
_agentSignifier_: an agent signifier,
_realm_: a Realm Record,
): ~unused~
</h1>
<dl class="header">
</dl>
<p>An implementation of HostEnqueueCrossAgentJob schedules _job_ in the agent signified by _agentSignifier_. It must also conform to the requirements in <emu-xref href="#sec-jobs"></emu-xref>.</p>
<p>An implementation of HostEnqueueCrossAgentJob schedules _job_ in the realm _realm_ in the agent signified by _agentSignifier_. It must also conform to the requirements in <emu-xref href="#sec-jobs"></emu-xref>.</p>
</emu-clause>

<emu-clause id="sec-dowait" type="abstract operation">
Expand Down Expand Up @@ -42736,26 +42738,26 @@ <h1>
<dl class="header">
</dl>
<emu-alg>
1. Let _timeoutJob_ be a new Job Abstract Closure with no parameters that captures _WL_ and _waiterRecord_ and performs the following steps when called:
1. Perform EnterCriticalSection(_WL_).
1. If _WL_.[[Waiters]] contains _waiterRecord_, then
1. Let _now_ be the time value (UTC) identifying the current time.
1. Assert: ℝ(_now_) ≥ _waiterRecord_.[[TimeoutTime]].
1. Set _waiterRecord_.[[Result]] to *"timed-out"*.
1. Perform RemoveWaiter(_WL_, _waiterRecord_).
1. Perform NotifyWaiter(_WL_, _waiterRecord_).
1. Perform LeaveCriticalSection(_WL_).
1. Return ~unused~.
1. Let _now_ be the time value (UTC) identifying the current time.
1. Perform HostEnqueueTimeoutJob(_timeoutJob_, 𝔽(_waiterRecord_.[[TimeoutTime]]) - _now_).
1. Let _timeoutJob_ be a new Job Abstract Closure with no parameters that captures _WL_ and _waiterRecord_ and performs the following steps when called:
1. Perform EnterCriticalSection(_WL_).
1. If _WL_.[[Waiters]] contains _waiterRecord_, then
1. Let _now_ be the time value (UTC) identifying the current time.
1. Assert: ℝ(_now_) ≥ _waiterRecord_.[[TimeoutTime]].
1. Set _waiterRecord_.[[Result]] to *"timed-out"*.
1. Perform RemoveWaiter(_WL_, _waiterRecord_).
1. Perform NotifyWaiter(_WL_, _waiterRecord_).
1. Perform LeaveCriticalSection(_WL_).
1. Return ~unused~.
1. Let _now_ be the time value (UTC) identifying the current time.
1. Perform HostEnqueueTimeoutJob(_timeoutJob_, 𝔽(_waiterRecord_.[[TimeoutTime]]) - _now_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-hostenqueuetimeoutjob" type="host-defined abstract operation">
<h1>
HostEnqueueTimeoutJob (
_timeoutJob_: a Job Abstract Closure,
_milliseconds_: a Number,
_milliseconds_: a non-negative integral Number,
): ~unused~
</h1>
<dl class="header">
Expand Down

0 comments on commit e9c80e3

Please sign in to comment.