Correct logic in Switch.whileOff, see #2569
This commit is contained in:
parent
d9eaace907
commit
85a4743a47
1 changed files with 1 additions and 1 deletions
|
|
@ -115,7 +115,7 @@ class Switch(startAsOn: Boolean = false) {
|
|||
* Be careful of longrunning or blocking within the provided action as it can lead to deadlocks or bad performance
|
||||
*/
|
||||
def whileOff(action: ⇒ Unit): Boolean = synchronized {
|
||||
if (switch.get) {
|
||||
if (!switch.get) {
|
||||
action
|
||||
true
|
||||
} else false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue