blob: e2144ee1d91211393a3da441daf53db6cec0d926 [file] [log] [blame]
package kotlinx.coroutines.experimental.io
import kotlinx.coroutines.experimental.*
import kotlin.coroutines.experimental.CoroutineContext
internal open class ByteChannelCoroutine(
parentContext: CoroutineContext,
open val channel: ByteChannel
) : AbstractCoroutine<Unit>(parentContext, active = true) {
override fun onCancellation(cause: Throwable?) {
if (!channel.close(cause) && cause != null)
handleCoroutineException(context, cause)
}
}