w3c / web-locks

Cross-tab resource coordination API
https://w3c.github.io/web-locks/
Other
124 stars 16 forks source link

Give a timeout limit when acquiring lock #41

Closed arthurhsu closed 6 years ago

arthurhsu commented 6 years ago

It would be nice to specify a timeout for lock (i.e. how long should this lock be there). A worker thread can have bugs looping forever without releasing locks, and there will be no way to re-gain the lock.

This can also promote shorter locks if default is a reasonable amount of time instead of infinite.

ralphch0 commented 6 years ago

This is the motivation behind the "steal" feature. The difficulties with both of these features is that it's not easy to interrupt running code that's holding the lock, unless we introduce some kind of page crash/reload when the lock is stolen (or expires).

inexorabletash commented 6 years ago

Closing this pending feedback that "steal" is insufficient here. I'd like to avoid introducing another mechanism.