aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/sqlite3-opfs-async-proxy.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-09-20 10:11:52 +0000
committerstephan <stephan@noemail.net>2022-09-20 10:11:52 +0000
commitc9e2602e8f55d7a40d36ef6080529c7fa96ed11f (patch)
tree38102e9fe2d002b6071fc85a3aa9e92f3c0ee812 /ext/wasm/sqlite3-opfs-async-proxy.js
parent5e8bb0aa13628208b7baedd720ba4aaaac2cc239 (diff)
downloadsqlite-c9e2602e8f55d7a40d36ef6080529c7fa96ed11f.tar.gz
sqlite-c9e2602e8f55d7a40d36ef6080529c7fa96ed11f.zip
Remove extraneous result-code SAB slots. Doc additions.
FossilOrigin-Name: 88de20712bbe3e11ea74af95edc34e9ab9f346f9aa0a30931e5a9e1f96ce57b0
Diffstat (limited to 'ext/wasm/sqlite3-opfs-async-proxy.js')
-rw-r--r--ext/wasm/sqlite3-opfs-async-proxy.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/wasm/sqlite3-opfs-async-proxy.js b/ext/wasm/sqlite3-opfs-async-proxy.js
index a2e0dc523..6caf21597 100644
--- a/ext/wasm/sqlite3-opfs-async-proxy.js
+++ b/ext/wasm/sqlite3-opfs-async-proxy.js
@@ -134,9 +134,9 @@ const getDirForPath = async function f(absFilename, createDirs = false){
and then Atomics.notify()'s it.
*/
const storeAndNotify = (opName, value)=>{
- log(opName+"() => notify(",state.rcIds[opName],",",value,")");
- Atomics.store(state.sabOPView, state.rcIds[opName], value);
- Atomics.notify(state.sabOPView, state.rcIds[opName]);
+ log(opName+"() => notify(",state.opIds.rc,",",value,")");
+ Atomics.store(state.sabOPView, state.opIds.rc, value);
+ Atomics.notify(state.sabOPView, state.opIds.rc);
};
/**
@@ -460,17 +460,19 @@ const initS11n = ()=>{
const waitLoop = async function f(){
const opHandlers = Object.create(null);
- for(let k of Object.keys(state.rcIds)){
+ for(let k of Object.keys(state.opIds)){
+ const vi = vfsAsyncImpls[k];
+ if(!vi) continue;
const o = Object.create(null);
opHandlers[state.opIds[k]] = o;
o.key = k;
- o.f = vfsAsyncImpls[k];// || toss("No vfsAsyncImpls[",k,"]");
+ o.f = vi;// || toss("No vfsAsyncImpls[",k,"]");
}
let metricsTimer = self.location.port>=1024 ? performance.now() : 0;
// ^^^ in dev environment, dump out these metrics one time after a delay.
while(true){
try {
- if('timed-out'===Atomics.wait(state.sabOPView, state.opIds.whichOp, 0, 150)){
+ if('timed-out'===Atomics.wait(state.sabOPView, state.opIds.whichOp, 0, 500)){
continue;
}
const opId = Atomics.load(state.sabOPView, state.opIds.whichOp);
@@ -513,7 +515,6 @@ navigator.storage.getDirectory().then(function(d){
state.sabFileBufView = new Uint8Array(state.sabIO, 0, state.fileBufferSize);
state.sabS11nView = new Uint8Array(state.sabIO, state.sabS11nOffset, state.sabS11nSize);
state.opIds = opt.opIds;
- state.rcIds = opt.rcIds;
state.sq3Codes = opt.sq3Codes;
Object.keys(vfsAsyncImpls).forEach((k)=>{
if(!Number.isFinite(state.opIds[k])){