You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is not much we can do.
We can't resume coroutine in a semi-updated context. If we can't resume it (and cancellation implies resume with exception), we can't complete it, so any join will hang.
All solutions may lead to unexpected behaviour:
Resuming job in a semi-updated context breaks the contract of ThreadContextElement
Transferring job to the final state breaks atomicity and cancellation contract
Catching and reporting exceptions in every context element and then resuming coroutine will effectively disable "restore" and may leave context element in an inconsistent state.
An exception in
updateThreadContext
breaks job cancellation sequence so the following example hangs foreverI'd expect it to cancel job and resume
join
(since it is running not underMyElement
so it is possible to resume it) however it remainsActive
The text was updated successfully, but these errors were encountered: