aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-vfs-opfs.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-11-30 08:37:17 +0000
committerstephan <stephan@noemail.net>2022-11-30 08:37:17 +0000
commitc5141c9efa564dc6e6d39685b23741d6632dae5a (patch)
tree8d269935d1ccc8609b9a9bb485b78edd71edf72d /ext/wasm/api/sqlite3-vfs-opfs.js
parente7f5118bd347e83348417c91eda187d865938e4e (diff)
downloadsqlite-c5141c9efa564dc6e6d39685b23741d6632dae5a.tar.gz
sqlite-c5141c9efa564dc6e6d39685b23741d6632dae5a.zip
Simplify how the OPFS VFS async proxy copies initial state sent to it from the synchronous side of the connection. Make the lock-wait time a multiple of the wait-loop timeout interval.
FossilOrigin-Name: eddafafffa634a42ceeed70aa3fc58be130527612157a4bf4ff9e65c7f6dc26c
Diffstat (limited to 'ext/wasm/api/sqlite3-vfs-opfs.js')
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.js b/ext/wasm/api/sqlite3-vfs-opfs.js
index bd258759c..7b0a0b322 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs.js
@@ -269,6 +269,16 @@ const installOpfsVfs = function callee(options){
return new Int16Array(buffer)[0] === 256;
})();
/**
+ asyncIdleWaitTime is how long (ms) to wait, in the async proxy,
+ for each Atomics.wait() when waiting on inbound VFS API calls.
+ We need to wake up periodically to give the thread a chance to
+ do other things. If this is too high (e.g. 500ms) then even two
+ workers/tabs can easily run into locking errors. Some multiple
+ of this value is also used for determining how long to wait on
+ lock contention to free up.
+ */
+ state.asyncIdleWaitTime = 100;
+ /**
Whether the async counterpart should log exceptions to
the serialization channel. That produces a great deal of
noise for seemingly innocuous things like xAccess() checks