We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0501084 commit ee2df40Copy full SHA for ee2df40
runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/util/SingleFlightGroup.kt
@@ -30,7 +30,7 @@ public class SingleFlightGroup<T> {
30
public suspend fun singleFlight(block: suspend () -> T): T {
31
mu.lock()
32
val job = inFlight
33
- if (job != null) {
+ if (job?.isActive == true) {
34
waitCount++
35
mu.unlock()
36
@@ -52,6 +52,6 @@ public class SingleFlightGroup<T> {
52
inFlight = deferred
53
54
runCatching { block() }.let { deferred.complete(it) }
55
- return deferred.await().also { inFlight = null }.getOrThrow()
+ return deferred.await().getOrThrow()
56
}
57
0 commit comments