Skip to content

Commit

Permalink
unapply fix from pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxcapades committed May 17, 2024
1 parent 8831f53 commit 6faad76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/async/src/main/kotlin/vdi/component/async/Trigger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class Trigger {
private var triggered = false

suspend fun trigger() {
mutex.withLock { triggered = true }
mutex.withLock(this) { triggered = true }
tryRelease()
}

suspend fun isTriggered() = mutex.withLock { triggered }
suspend fun isTriggered() = mutex.withLock(this) { triggered }

suspend fun await() {
mutex.withLock {
mutex.withLock(this) {
if (triggered)
return release()
}
Expand All @@ -33,7 +33,7 @@ class Trigger {
}

private suspend fun tryRelease() {
mutex.withLock {
mutex.withLock(this) {
if (triggered)
release()
}
Expand Down

0 comments on commit 6faad76

Please sign in to comment.