Commit 5b143f4f authored by NzSN's avatar NzSN

update

parent 88aa6f05
...@@ -7,6 +7,8 @@ let bridge = null; ...@@ -7,6 +7,8 @@ let bridge = null;
let muxer = null; let muxer = null;
let numOfEncs = 1; let numOfEncs = 1;
let channels = [];
// Constants // Constants
const SLEEP_INTERVAL = 100; const SLEEP_INTERVAL = 100;
const SPIN_TIMEOUT = 500; const SPIN_TIMEOUT = 500;
...@@ -89,6 +91,7 @@ async function bridging(msg) { ...@@ -89,6 +91,7 @@ async function bridging(msg) {
} }
bridge = new Channel(info.size, SharedArrayBuffer, info.shm); bridge = new Channel(info.size, SharedArrayBuffer, info.shm);
channels.push(bridge);
isBridged = true; isBridged = true;
} }
...@@ -111,14 +114,15 @@ async function steps() { ...@@ -111,14 +114,15 @@ async function steps() {
src.setPriv(MSG.PRIV_FLAGS.EXECUTING); src.setPriv(MSG.PRIV_FLAGS.EXECUTING);
while (timeout > 0) { while (timeout > 0) {
if (await step() === false && retryCount >= 0) { if (await step() === false) {
timeout -= SLEEP_INTERVAL;
await sleep(SLEEP_INTERVAL); await sleep(SLEEP_INTERVAL);
timeout -= SLEEP_INTERVAL;
} else {
timeout = SPIN_TIMEOUT;
} }
} }
src.unsetPriv(MSG.PRIV_FLAGS.EXECUTING); src.unsetPriv(MSG.PRIV_FLAGS.EXECUTING);
postMessage(makeMsg(MESSAGE_TYPE.DATA_REQUIRE, {})) postMessage(makeMsg(MESSAGE_TYPE.DATA_REQUIRE, {}));
} }
...@@ -182,7 +182,7 @@ describe("EncWW Specifications", () => { ...@@ -182,7 +182,7 @@ describe("EncWW Specifications", () => {
await sleep(1000); await sleep(1000);
}); });
fit("Mux WW Spec", async () => { it("Mux WW Spec", async () => {
let mux = new WW("MUX", "../resources/workers/muxWW.js"); let mux = new WW("MUX", "../resources/workers/muxWW.js");
let mem = new SharedArrayBuffer(1024); let mem = new SharedArrayBuffer(1024);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment