@@ -167,8 +167,7 @@ internal abstract class AbstractSendChannel<E> : SendChannel<E> {
167
167
// ------ SendChannel ------
168
168
169
169
public final override val isClosedForSend: Boolean get() = closedForSend != null
170
- public final override val isFull: Boolean get() = full
171
- private val full: Boolean get() = queue.nextNode !is ReceiveOrClosed <* > && isBufferFull // TODO rename to `isFull`
170
+ private val isFull: Boolean get() = queue.nextNode !is ReceiveOrClosed <* > && isBufferFull
172
171
173
172
public final override suspend fun send (element : E ) {
174
173
// fast path -- try offer non-blocking
@@ -403,7 +402,7 @@ internal abstract class AbstractSendChannel<E> : SendChannel<E> {
403
402
private fun <R > registerSelectSend (select : SelectInstance <R >, element : E , block : suspend (SendChannel <E >) -> R ) {
404
403
while (true ) {
405
404
if (select.isSelected) return
406
- if (full ) {
405
+ if (isFull ) {
407
406
val enqueueOp = TryEnqueueSendDesc (element, select, block)
408
407
val enqueueResult = select.performAtomicIfNotSelected(enqueueOp) ? : return
409
408
when {
@@ -562,8 +561,7 @@ internal abstract class AbstractChannel<E> : AbstractSendChannel<E>(), Channel<E
562
561
// ------ ReceiveChannel ------
563
562
564
563
public final override val isClosedForReceive: Boolean get() = closedForReceive != null && isBufferEmpty
565
- public final override val isEmpty: Boolean get() = empty
566
- private val empty: Boolean get() = queue.nextNode !is Send && isBufferEmpty // TODO rename to `isEmpty`
564
+ private val isEmpty: Boolean get() = queue.nextNode !is Send && isBufferEmpty
567
565
568
566
@Suppress(" UNCHECKED_CAST" )
569
567
public final override suspend fun receive (): E {
@@ -750,7 +748,7 @@ internal abstract class AbstractChannel<E> : AbstractSendChannel<E>(), Channel<E
750
748
private fun <R > registerSelectReceive (select : SelectInstance <R >, block : suspend (E ) -> R ) {
751
749
while (true ) {
752
750
if (select.isSelected) return
753
- if (empty ) {
751
+ if (isEmpty ) {
754
752
val enqueueOp = TryEnqueueReceiveDesc (select, block as (suspend (E ? ) -> R ), nullOnClose = false )
755
753
val enqueueResult = select.performAtomicIfNotSelected(enqueueOp) ? : return
756
754
when {
@@ -784,7 +782,7 @@ internal abstract class AbstractChannel<E> : AbstractSendChannel<E>(), Channel<E
784
782
private fun <R > registerSelectReceiveOrNull (select : SelectInstance <R >, block : suspend (E ? ) -> R ) {
785
783
while (true ) {
786
784
if (select.isSelected) return
787
- if (empty ) {
785
+ if (isEmpty ) {
788
786
val enqueueOp = TryEnqueueReceiveDesc (select, block, nullOnClose = true )
789
787
val enqueueResult = select.performAtomicIfNotSelected(enqueueOp) ? : return
790
788
when {
0 commit comments