metasync
metasync copied to clipboard
WIP: Web Locks API initial implementation
Refs: https://github.com/metarhia/metasync/issues/416
@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.
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.
In new implementation:
- Mutex class is merged into Lock class
- Added: AbortError, AbortSignal, AbortController