Commit 5b143f4f authored by NzSN's avatar NzSN

update

parent 88aa6f05
......@@ -7,6 +7,8 @@ let bridge = null;
let muxer = null;
let numOfEncs = 1;
let channels = [];
// Constants
const SLEEP_INTERVAL = 100;
const SPIN_TIMEOUT = 500;
......@@ -89,6 +91,7 @@ async function bridging(msg) {
}
bridge = new Channel(info.size, SharedArrayBuffer, info.shm);
channels.push(bridge);
isBridged = true;
}
......@@ -111,14 +114,15 @@ async function steps() {
src.setPriv(MSG.PRIV_FLAGS.EXECUTING);
while (timeout > 0) {
if (await step() === false && retryCount >= 0) {
timeout -= SLEEP_INTERVAL;
if (await step() === false) {
await sleep(SLEEP_INTERVAL);
timeout -= SLEEP_INTERVAL;
} else {
timeout = SPIN_TIMEOUT;
}
}
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", () => {
await sleep(1000);
});
fit("Mux WW Spec", async () => {
it("Mux WW Spec", async () => {
let mux = new WW("MUX", "../resources/workers/muxWW.js");
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