Repository navigation
Cleanups on how we do tasks and promises - #1032
Conversation
|
cc @annevk |
| @@ -313,8 +313,8 @@ When this method is invoked, it MUST run the following steps: | |||
| 1. Run the following steps [=in parallel=]: | |||
| 1. [=ensures an immersive XR device is selected|Ensure an immersive XR device is selected=]. | |||
There was a problem hiding this comment.
This step is running in a parallel thread but then you invoke something that grabs objects from the main thread. I think you need to make that more clear and separate what happens on the main thread and what happens in parallel.
Also, the selection that happens here presumably updates the state on the main thread. That should happen in the same task that eventually resolves the promise. This also goes for the step below here where you resolve with false.
Does that makes sense?
(I suspect something similar applies to the other in parallel algorithm, but I did not look in detail.)
There was a problem hiding this comment.
Hmm, so that's a little bit tricky: there are some parts of the ensure selected algorithm that need to run on the main thread, and some that don't. There doesn't seem to be an easy way to chain async algorithms in spec text.
There was a problem hiding this comment.
I'm going to merge this PR because this is an unrelated issue, but filing a new one.
fixes #1020, fixes #1022
I didn't update every instance of "queue a task" because both WebGL and HTML's Websocket section specify the task source used once in the document.
Preview | Diff