Skip to content

Commit 3e5acfd

Browse files
committed
Explain benign data-race on SelectImplementation.clauses and mark it with @BenignDataRace
Fixes #3843
1 parent 8ad012a commit 3e5acfd

File tree

1 file changed

+5
-0
lines changed
  • kotlinx-coroutines-core/common/src/selects

1 file changed

+5
-0
lines changed

kotlinx-coroutines-core/common/src/selects/Select.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,12 @@ internal open class SelectImplementation<R>(
372372

373373
/**
374374
* List of clauses waiting on this `select` instance.
375+
*
376+
* This property is the subject to bening data-race: concurrent cancellation might null-out this property
377+
* while [trySelect] operation reads it and iterates over its content.
378+
* A logical race is resolved by the consensus on [state] property.
375379
*/
380+
@BenignDataRace
376381
private var clauses: MutableList<ClauseData>? = ArrayList(2)
377382

378383
/**

0 commit comments

Comments
 (0)