The first one would be to check the property isClosedForReceive, which indicates whether or not the channel has been closed for receiving, as the following for example:
val channel = Channel<Int>()
channel.isClosedForReceive // false
channel.close()
channel.isClosedForReceive // true
If receive is called in a channel that is closed, a ClosedReceiveChannelException will be thrown:
val channel = Channel<Int>()
channel.close()
channel.receive()
This code will simply crash: