metasync icon indicating copy to clipboard operation
metasync copied to clipboard

WIP: Web Locks API initial implementation

Open tshemsedinov opened this issue 5 years ago • 3 comments

Refs: https://github.com/metarhia/metasync/issues/416

tshemsedinov avatar Mar 26 '19 21:03 tshemsedinov

@tshemsedinov isn't it supposed to be compliant with the spec for Web Locks API? It defines two interfaces: LockManager and Lock, both of which are not present in the implementation in this PR. Thus I don't think it should be called 'Web Locks API implementation' unless you implement the interfaces mentioned above.

belochub avatar Mar 27 '19 08:03 belochub

Yes, but it's just proof of concept and WIP. @belochub I'll implement also options: { mode: "exclusive" | "shared", signal <AbortSignal>, ifAvailable <boolean> } and extend specification with timeout, recursive locking and locking queue in each thread, error handling in critical section, etc.

tshemsedinov avatar Mar 27 '19 09:03 tshemsedinov

In new implementation:

  • Mutex class is merged into Lock class
  • Added: AbortError, AbortSignal, AbortController

tshemsedinov avatar Dec 01 '19 23:12 tshemsedinov