aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-07-11 12:36:28 +0000
committerstephan <stephan@noemail.net>2024-07-11 12:36:28 +0000
commitd3bb31b93152362123243806378edb1af3a5ce5d (patch)
treea36b2864d1ec4089c94816b25f7acff8011c2a41 /ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
parent64ef4582c2018dac671282c3432c72a998549d24 (diff)
downloadsqlite-d3bb31b93152362123243806378edb1af3a5ce5d.tar.gz
sqlite-d3bb31b93152362123243806378edb1af3a5ce5d.zip
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
Diffstat (limited to 'ext/wasm/api/sqlite3-vfs-opfs.c-pp.js')
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.c-pp.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
index fc0fb9db9..da556224a 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js
@@ -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);