1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Proposed workaround for the "errant op" case in the OPFS VFS, as discussed in [https://github.com/sqlite/sqlite-wasm/issues/12 | issue #12 of the npm distribution].

FossilOrigin-Name: 64f4f3cd878b1a723caa0cd54b21f10fdb27d4e2ecb19fc233cbc8dd9d06f259
This commit is contained in:
stephan
2024-07-11 12:36:28 +00:00
parent 64ef4582c2
commit d3bb31b931
3 changed files with 16 additions and 11 deletions

View File

@@ -470,7 +470,9 @@ const installOpfsVfs = function callee(options){
Atomics.notify(state.sabOPView, state.opIds.whichOp)
/* async thread will take over here */;
const t = performance.now();
Atomics.wait(state.sabOPView, state.opIds.rc, -1)
while('not-equal'!==Atomics.wait(state.sabOPView, state.opIds.rc, -1)){
/* See discussion at https://github.com/sqlite/sqlite-wasm/issues/12 */
}
/* When this wait() call returns, the async half will have
completed the operation and reported its results. */;
const rc = Atomics.load(state.sabOPView, state.opIds.rc);