File tree 2 files changed +6
-6
lines changed
kotlinx-coroutines-core/common/src/selects
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ import kotlin.native.concurrent.*
50
50
* Use [yield] or [CoroutineScope.isActive] to periodically check for cancellation in tight loops if needed.
51
51
*/
52
52
public suspend inline fun <R > select (crossinline builder : SelectBuilder <R >.() -> Unit ): R {
53
+ contract {
54
+ callsInPlace(builder, InvocationKind .EXACTLY_ONCE )
55
+ }
53
56
return selectOld(builder)
54
- // contract {
55
- // callsInPlace(builder, InvocationKind.EXACTLY_ONCE)
56
- // }
57
57
// return SelectImplementation<R>(coroutineContext).run {
58
58
// builder(this)
59
59
// // TAIL-CALL OPTIMIZATION: the only
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ import kotlin.coroutines.*
19
19
* See [select] function description for all the other details.
20
20
*/
21
21
public suspend inline fun <R > selectUnbiased (crossinline builder : SelectBuilder <R >.() -> Unit ): R {
22
+ contract {
23
+ callsInPlace(builder, InvocationKind .EXACTLY_ONCE )
24
+ }
22
25
return selectUnbiasedOld(builder)
23
- // contract {
24
- // callsInPlace(builder, InvocationKind.EXACTLY_ONCE)
25
- // }
26
26
// return UnbiasedSelectImplementation<R>(coroutineContext).run {
27
27
// builder(this)
28
28
// doSelect()
You can’t perform that action at this time.
0 commit comments