Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discard Guard, instead use a Mutex directly in DefaultApolloStore
- Loading branch information
Showing
9 changed files
with
64 additions
and
172 deletions.
There are no files selected for viewing
31 changes: 0 additions & 31 deletions
31
...d-cache/src/appleMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/Guard.kt
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...leMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/runBlockingWithMutex.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.apollographql.apollo3.cache.normalized.internal | ||
|
||
import kotlinx.coroutines.runBlocking | ||
import kotlinx.coroutines.sync.Mutex | ||
import kotlinx.coroutines.sync.withLock | ||
|
||
internal actual fun runBlockingWithMutex(mutex: Mutex, block: () -> Unit) { | ||
runBlocking { | ||
mutex.withLock { | ||
block() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...-cache/src/commonMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/Guard.kt
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...onMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/runBlockingWithMutex.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.apollographql.apollo3.cache.normalized.internal | ||
|
||
import kotlinx.coroutines.sync.Mutex | ||
|
||
internal expect fun runBlockingWithMutex(mutex: Mutex, block: () -> Unit) |
20 changes: 0 additions & 20 deletions
20
...ized-cache/src/jsMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/Guard.kt
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...jsMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/runBlockingWithMutex.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.apollographql.apollo3.cache.normalized.internal | ||
|
||
import kotlinx.coroutines.sync.Mutex | ||
|
||
internal actual fun runBlockingWithMutex(mutex: Mutex, block: () -> Unit) = block() |
31 changes: 0 additions & 31 deletions
31
...zed-cache/src/jvmMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/Guard.kt
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...vmMain/kotlin/com/apollographql/apollo3/cache/normalized/internal/runBlockingWithMutex.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.apollographql.apollo3.cache.normalized.internal | ||
|
||
import kotlinx.coroutines.runBlocking | ||
import kotlinx.coroutines.sync.Mutex | ||
import kotlinx.coroutines.sync.withLock | ||
|
||
internal actual fun runBlockingWithMutex(mutex: Mutex, block: () -> Unit) { | ||
runBlocking { | ||
mutex.withLock { | ||
block() | ||
} | ||
} | ||
} |