Skip to content

Commit

Permalink
Mention benign data-race in getResult (#2663)
Browse files Browse the repository at this point in the history
Addresses #2660
  • Loading branch information
qwwdfsad authored Apr 21, 2021
1 parent 71df60e commit e49cf79
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,13 @@ internal open class CancellableContinuationImpl<in T>(
// or we got async cancellation from parent.
if (trySuspend()) {
/*
* Invariant: parentHandle is `null` *only* for reusable continuations.
* We were neither resumed nor cancelled, time to suspend.
* But first we have to install parent cancellation handle (if we didn't yet),
* so CC could be properly resumed on parent cancellation.
*
* This read has benign data-race with write of 'NonDisposableHandle'
* in 'detachChildIfNotReusable'.
*/
if (parentHandle == null) {
installParentHandle()
Expand Down

0 comments on commit e49cf79

Please sign in to comment.