This is an excerpt from Mutex.kt. I think `cont.in...
# coroutines
w
This is an excerpt from Mutex.kt. I think
cont.initCancellability()
should be placed after
removeXXX
. Because if the coroutine was cancelled right after the init call, the waiter won't be removed.
e
removeOnCancellation
immediately removes the node if it is invoked on a continuation that is already cancelled.
w
So, it seems it doesn't matter when to invoke
initCancellability
.
e
Correct. It does not matter
w
thx