File tree 1 file changed +4
-4
lines changed
reactive/kotlinx-coroutines-reactive/src 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public class FlowSubscription<T>(
40
40
) : Subscription {
41
41
@Volatile
42
42
private var canceled: Boolean = false
43
- private val requested = AtomicLong (0L )
43
+ private val requested = atomic (0L )
44
44
private val producer = atomic<CancellableContinuation <Unit >? > (null )
45
45
46
46
// This is actually optimizable
@@ -69,10 +69,10 @@ public class FlowSubscription<T>(
69
69
* No intermediate "child failed, but flow coroutine is not" states are allowed.
70
70
*/
71
71
coroutineContext.ensureActive()
72
- if (requested.get() == 0L ) {
72
+ if (requested.value == 0L ) {
73
73
suspendCancellableCoroutine<Unit > {
74
74
producer.value = it
75
- if (requested.get() != 0L ) it.resumeSafely()
75
+ if (requested.value != 0L ) it.resumeSafely()
76
76
}
77
77
}
78
78
requested.decrementAndGet()
@@ -93,7 +93,7 @@ public class FlowSubscription<T>(
93
93
var snapshot: Long
94
94
var newValue: Long
95
95
do {
96
- snapshot = requested.get()
96
+ snapshot = requested.value
97
97
newValue = snapshot + n
98
98
if (newValue <= 0L ) newValue = Long .MAX_VALUE
99
99
} while (! requested.compareAndSet(snapshot, newValue))
You can’t perform that action at this time.
0 commit comments