Skip to content

Commit e49cf79

Browse files
authored
Mention benign data-race in getResult (#2663)
Addresses #2660
1 parent 71df60e commit e49cf79

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kotlinx-coroutines-core/common/src/CancellableContinuationImpl.kt

+4
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,13 @@ internal open class CancellableContinuationImpl<in T>(
260260
// or we got async cancellation from parent.
261261
if (trySuspend()) {
262262
/*
263+
* Invariant: parentHandle is `null` *only* for reusable continuations.
263264
* We were neither resumed nor cancelled, time to suspend.
264265
* But first we have to install parent cancellation handle (if we didn't yet),
265266
* so CC could be properly resumed on parent cancellation.
267+
*
268+
* This read has benign data-race with write of 'NonDisposableHandle'
269+
* in 'detachChildIfNotReusable'.
266270
*/
267271
if (parentHandle == null) {
268272
installParentHandle()

0 commit comments

Comments
 (0)