Skip to content

Commit 7bbc362

Browse files
committed
Review fixes
Signed-off-by: Nikita Koval <[email protected]>
1 parent 6322ded commit 7bbc362

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

kotlinx-coroutines-core/common/src/channels/BufferedChannel.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,7 @@ internal open class BufferedChannel<E>(
20302030
// The cell stores a buffered element.
20312031
state === BUFFERED -> {
20322032
// Is the cell already covered by a receiver?
2033-
if (globalIndex < receiversCounter) return
2033+
if (globalIndex < receiversCounter) break@traverse
20342034
// Update the cell state to `CHANNEL_CLOSED`.
20352035
if (segment.casState(index, state, CHANNEL_CLOSED)) {
20362036
// If `onUndeliveredElement` lambda is non-null, call it.
@@ -2057,7 +2057,7 @@ internal open class BufferedChannel<E>(
20572057
// The cell stores a suspended waiter.
20582058
state is Waiter || state is WaiterEB -> {
20592059
// Is the cell already covered by a receiver?
2060-
if (globalIndex < receiversCounter) return
2060+
if (globalIndex < receiversCounter) break@traverse
20612061
// Obtain the sender.
20622062
val sender: Waiter = if (state is WaiterEB) state.waiter
20632063
else state as Waiter
@@ -2908,8 +2908,7 @@ private val RESUMING_BY_EB = Symbol("RESUMING_BY_EB")
29082908
private val POISONED = Symbol("POISONED")
29092909
// When the element is successfully transferred
29102910
// to a receiver, the cell changes to `DONE_RCV`.
2911-
@JvmField
2912-
internal val DONE_RCV = Symbol("DONE_RCV")
2911+
private val DONE_RCV = Symbol("DONE_RCV")
29132912
// Cancelled sender.
29142913
private val INTERRUPTED_SEND = Symbol("INTERRUPTED_SEND")
29152914
// Cancelled receiver.

kotlinx-coroutines-core/jvm/test/TestBase.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private val VERBOSE = systemProp("test.verbose", false)
1818
/**
1919
* Is `true` when running in a nightly stress test mode.
2020
*/
21-
public actual val isStressTest = true // System.getProperty("stressTest")?.toBoolean() ?: false
21+
public actual val isStressTest = System.getProperty("stressTest")?.toBoolean() ?: false
2222

2323
public actual val stressTestMultiplierSqrt = if (isStressTest) 5 else 1
2424

kotlinx-coroutines-core/jvm/test/lincheck/ChannelsLincheckTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ abstract class ChannelLincheckTestBase(
144144
@Operation(causesBlocking = true, blocking = true)
145145
fun close(@Param(name = "closeToken") token: Int): Boolean = c.close(NumberedCancellationException(token))
146146

147-
// @Operation(causesBlocking = true, blocking = true)
147+
@Operation(causesBlocking = true, blocking = true)
148148
fun cancel(@Param(name = "closeToken") token: Int) = c.cancel(NumberedCancellationException(token))
149149

150150
// @Operation TODO non-linearizable in BufferedChannel

0 commit comments

Comments
 (0)