Cancellation of suspended receive is atomic – when this function throws CancellationException it means that the element was not retrieved from this channel. As a side-effect of atomic cancellation, a thread-bound coroutine (to some UI thread, for example) may continue to execute even after it was cancelled from the same thread in the case when this receive operation was already resumed and the continuation was posted for execution to the thread’s queue.
This extension is defined only for channels on non-null types, so that generic functions defined using
these extensions do not accidentally confuse
null value and a normally closed channel, leading to hard
to find bugs.