Skip to content

Commit 4be398d

Browse files
committed
Fix code style
1 parent 3b8e377 commit 4be398d

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

JavaScript/1-mutex.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ if (isMainThread) {
5050
}
5151
}, 100);
5252
});
53-
} else {
54-
if (!mutex.leave()) {
55-
console.log('Can not leave mutex: not owner');
56-
}
53+
} else if (!mutex.leave()) {
54+
console.log('Can not leave mutex: not owner');
5755
}
5856
}

JavaScript/5-no-race.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if (isMainThread) {
7575
const array = new Int32Array(workerData, 4, 2);
7676
const point = new Point(array);
7777
if (threadId === 1) {
78-
for (let i = 0; i < 1000000; i++) {
78+
for (let i = 0; i < 1000000; i++) {
7979
mutex.enter();
8080
point.move(1, 1);
8181
mutex.leave();

0 commit comments

Comments
 (0)