Why this is blocking and not completing?
class WaitAndNotify {
private var _subscriptionCount = 0
private val channel = Channel(0)
val subscriptionCount = _subscriptionCount
/**
* Calling coroutine will wait/suspend
* until another coroutine notify
*/
suspend fun wait() {
_subscriptionCount++
channel.receive()
}
suspend fun notify() {
channel.send(Unit)
}
suspend fun notifyAll() {
repeat(_subscriptionCount) {
channel.send(Unit)...