File tree Expand file tree Collapse file tree 7 files changed +7
-17
lines changed Expand file tree Collapse file tree 7 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,10 @@ class Mutex {
18
18
Atomics . store ( this . lock , 0 , LOCKED ) ;
19
19
this . owner = true ;
20
20
setTimeout ( callback , 0 ) ;
21
- return true ;
22
21
}
23
22
24
23
leave ( ) {
25
- if ( ! this . owner ) return false ;
24
+ if ( ! this . owner ) return ;
26
25
Atomics . store ( this . lock , 0 , UNLOCKED ) ;
27
26
Atomics . notify ( this . lock , 0 , 1 ) ;
28
27
this . owner = false ;
Original file line number Diff line number Diff line change @@ -18,15 +18,13 @@ class Mutex {
18
18
Atomics . store ( this . lock , 0 , LOCKED ) ;
19
19
this . owner = true ;
20
20
setTimeout ( callback , 0 ) ;
21
- return true ;
22
21
}
23
22
24
23
leave ( ) {
25
- if ( ! this . owner ) return false ;
24
+ if ( ! this . owner ) return ;
26
25
Atomics . store ( this . lock , 0 , UNLOCKED ) ;
27
26
Atomics . notify ( this . lock , 0 , 1 ) ;
28
27
this . owner = false ;
29
- return true ;
30
28
}
31
29
}
32
30
Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ class Mutex {
20
20
Atomics . store ( this . lock , 0 , LOCKED ) ;
21
21
this . owner = true ;
22
22
setTimeout ( callback , 0 ) ;
23
- return true ;
24
23
}
25
24
26
25
leave ( ) {
27
- if ( ! this . owner ) return false ;
26
+ if ( ! this . owner ) return ;
28
27
Atomics . store ( this . lock , 0 , UNLOCKED ) ;
29
28
Atomics . notify ( this . lock , 0 , 1 ) ;
30
29
this . owner = false ;
31
- return true ;
32
30
}
33
31
}
34
32
Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ class Mutex {
20
20
prev = Atomics . exchange ( this . lock , 0 , LOCKED ) ;
21
21
}
22
22
this . owner = true ;
23
- return true ;
24
23
}
25
24
26
25
leave ( ) {
27
- if ( ! this . owner ) return false ;
26
+ if ( ! this . owner ) return ;
28
27
Atomics . store ( this . lock , 0 , UNLOCKED ) ;
29
28
Atomics . notify ( this . lock , 0 , 1 ) ;
30
29
this . owner = false ;
31
- return true ;
32
30
}
33
31
}
34
32
Original file line number Diff line number Diff line change @@ -23,11 +23,10 @@ class Mutex {
23
23
}
24
24
25
25
leave ( ) {
26
- if ( ! this . owner ) return false ;
26
+ if ( ! this . owner ) return ;
27
27
Atomics . store ( this . lock , 0 , UNLOCKED ) ;
28
28
Atomics . notify ( this . lock , 0 , 1 ) ;
29
29
this . owner = false ;
30
- return true ;
31
30
}
32
31
}
33
32
Original file line number Diff line number Diff line change @@ -29,11 +29,10 @@ class Mutex {
29
29
}
30
30
31
31
leave ( ) {
32
- if ( ! this . owner ) return false ;
32
+ if ( ! this . owner ) return ;
33
33
Atomics . store ( this . lock , 0 , UNLOCKED ) ;
34
34
Atomics . notify ( this . lock , 0 , 1 ) ;
35
35
this . owner = false ;
36
- return true ;
37
36
}
38
37
}
39
38
Original file line number Diff line number Diff line change @@ -41,11 +41,10 @@ class Mutex {
41
41
}
42
42
43
43
leave ( ) {
44
- if ( ! this . owner ) return false ;
44
+ if ( ! this . owner ) return ;
45
45
Atomics . store ( this . lock , 0 , UNLOCKED ) ;
46
46
this . port . postMessage ( 'leave' ) ;
47
47
this . owner = false ;
48
- return true ;
49
48
}
50
49
}
51
50
You can’t perform that action at this time.
0 commit comments