We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71df60e commit e49cf79Copy full SHA for e49cf79
kotlinx-coroutines-core/common/src/CancellableContinuationImpl.kt
@@ -260,9 +260,13 @@ internal open class CancellableContinuationImpl<in T>(
260
// or we got async cancellation from parent.
261
if (trySuspend()) {
262
/*
263
+ * Invariant: parentHandle is `null` *only* for reusable continuations.
264
* We were neither resumed nor cancelled, time to suspend.
265
* But first we have to install parent cancellation handle (if we didn't yet),
266
* so CC could be properly resumed on parent cancellation.
267
+ *
268
+ * This read has benign data-race with write of 'NonDisposableHandle'
269
+ * in 'detachChildIfNotReusable'.
270
*/
271
if (parentHandle == null) {
272
installParentHandle()
0 commit comments