We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b8e377 commit 4be398dCopy full SHA for 4be398d
2 files changed
JavaScript/1-mutex.js
@@ -50,9 +50,7 @@ if (isMainThread) {
50
}
51
}, 100);
52
});
53
- } else {
54
- if (!mutex.leave()) {
55
- console.log('Can not leave mutex: not owner');
56
- }
+ } else if (!mutex.leave()) {
+ console.log('Can not leave mutex: not owner');
57
58
JavaScript/5-no-race.js
@@ -75,7 +75,7 @@ if (isMainThread) {
75
const array = new Int32Array(workerData, 4, 2);
76
const point = new Point(array);
77
if (threadId === 1) {
78
- for (let i = 0; i < 1000000; i++) {
+ for (let i = 0; i < 1000000; i++) {
79
mutex.enter();
80
point.move(1, 1);
81
mutex.leave();
0 commit comments