Atomics: further nit picking

This commit is contained in:
Rick Waldron 2018-05-18 15:24:57 -04:00
parent 7389389071
commit 22d3877a2a
3 changed files with 4 additions and 5 deletions

View File

@ -24,13 +24,12 @@ function getReport() {
return r;
}
$262.agent.start(
`
$262.agent.start(`
$262.agent.receiveBroadcast(function(sab) {
var i32a = new Int32Array(sab);
$262.agent.report(Atomics.wait(i32a, 0, 0, NaN)); // NaN => +Infinity
$262.agent.leaving();
})
});
`);
var i32a = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));

View File

@ -23,8 +23,8 @@ const i32a = new Int32Array(
$262.agent.start(`
$262.agent.receiveBroadcast(function(sab) {
var i32a = new Int32Array(sab);
var before = $262.agent.monotonicNow();
$262.agent.report("ready");
var before = $262.agent.monotonicNow();
Atomics.wait(i32a, 0, 0, ${TWO_SECOND_TIMEOUT});
$262.agent.report($262.agent.monotonicNow() - before);
$262.agent.leaving();

View File

@ -18,7 +18,7 @@ $262.agent.receiveBroadcast(function(sab, id) {
var diff = $262.agent.monotonicNow() - then; // Should be about 1000 ms but can be more
$262.agent.report(diff);
$262.agent.leaving();
})
});
`);
var i32a = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));