Closed saschanaz closed 3 years ago
Doing this makes the "request is not the first item" check in the term "grantable" redundant, since:
ifAvailable: true
checks grantability before enqueuing, so the queue must be empty for it to be grantableSo, I think we can remove the check and instead add a queue emptiness check for ifAvailable. What do you think, @inexorabletash ?
Aside: I noticed "To get the lock request queue from lock request queue map queueMap from resource name name, run these steps:" should read: "To get the lock request queue from lock request queue map queueMap for resource name name, run these steps:". We should fix that too, either this PR or elsewhere.
Doing this makes the "request is not the first item" check in the term "grantable" redundant, since:
- The queue processing algorithm only checks the grantability of the first item, so it's always the first.
ifAvailable: true
checks grantability before enqueuing, so the queue must be empty for it to be grantableSo, I think we can remove the check and instead add a queue emptiness check for ifAvailable. What do you think, @inexorabletash ?
To confirm, the ifAvailable check would say e.g. "If ifAvailable is true, and either queueMap is not empty or request is not grantable, then ..."
Then... SGTM I think. I'd add a "Note: ..." after the definition of grantable to indicate that this does not consider the state of the request queue.
@pwnall can you also think through this?
either queueMap is not empty
(Should be queue instead of queueMap)
either queueMap is not empty
(Should be queue instead of queueMap)
Yes, thanks!
If I haven't said so before: thank you very much for jumping in. As you can probably tell, I haven't been spending much time thinking about this spec recently, so having you look at it in detail is greatly appreciated. If you think I'm missing something (like this) please do call it out. And if I'm terse in my comments it's just because I'm distracted by other shiny things. You're doing awesome, please keep it up!
(On that note, there's an outstanding PR on adopting Storage terminology that it'd be great to get your eyes/feedback on.)
Thank you! Apologies for the delay.
Thanks!
BTW this didn't implement https://github.com/WICG/web-locks/pull/83#issuecomment-946250361, should I open another PR or do you have any objection?
Let's do another PR
Fixes #82
Preview | Diff