Debug toString for channels
Fixes #185
diff --git a/core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannel.kt b/core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannel.kt
index 8ce9008..fd8c79d 100644
--- a/core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannel.kt
+++ b/core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannel.kt
@@ -16,10 +16,9 @@
package kotlinx.coroutines.experimental.channels
-import kotlinx.coroutines.experimental.selects.ALREADY_SELECTED
-import kotlinx.coroutines.experimental.selects.SelectInstance
-import java.util.concurrent.locks.ReentrantLock
-import kotlin.concurrent.withLock
+import kotlinx.coroutines.experimental.selects.*
+import java.util.concurrent.locks.*
+import kotlin.concurrent.*
/**
* Channel with array buffer of a fixed [capacity].
@@ -245,4 +244,9 @@
// then clean all queued senders
super.cleanupSendQueueOnCancel()
}
+
+ // ------ debug ------
+
+ override val bufferDebugString: String
+ get() = "(buffer:capacity=${buffer.size},size=$size)"
}
\ No newline at end of file