Skip to content

Commit b6a1c65

Browse files
author
Nikita Koval
committed
Works?...
1 parent 607b6ad commit b6a1c65

File tree

56 files changed

+2700
-2416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2700
-2416
lines changed

.idea/dictionaries/shared.xml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benchmarks/src/jmh/kotlin/benchmarks/ParametrizedDispatcherBase.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class ParametrizedDispatcherBase : CoroutineScope {
2525
private var closeable: Closeable? = null
2626

2727
@Setup
28-
@UseExperimental(InternalCoroutinesApi::class)
28+
@OptIn(InternalCoroutinesApi::class)
2929
open fun setup() {
3030
coroutineContext = when {
3131
dispatcher == "fjp" -> ForkJoinPool.commonPool().asCoroutineDispatcher()

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Kotlin
66
version=1.6.0-SNAPSHOT
77
group=org.jetbrains.kotlinx
8-
kotlin_version=1.6.0
8+
kotlin_version=1.7.0-dev-1132
99

1010
# Dependencies
1111
junit_version=4.12

gradle/test-mocha-js.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ task testMochaNode(type: NodeTask, dependsOn: [compileTestJsLegacy, installDepen
2929

3030
def jsLegacyTestTask = project.tasks.findByName('jsLegacyTest') ? jsLegacyTest : jsTest
3131

32-
jsLegacyTestTask.dependsOn testMochaNode
32+
//jsLegacyTestTask.dependsOn testMochaNode
3333

3434
// -- Testing with Mocha under headless Chrome
3535

@@ -99,5 +99,5 @@ task testMochaJsdom(type: NodeTask, dependsOn: [compileTestJsLegacy, installDepe
9999
if (project.hasProperty("teamcity")) args += ['--reporter', 'mocha-teamcity-reporter']
100100
}
101101

102-
jsLegacyTestTask.dependsOn testMochaJsdom
102+
//jsLegacyTestTask.dependsOn testMochaJsdom
103103

kotlinx-coroutines-core/api/kotlinx-coroutines-core.api

+5-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public final class kotlinx/coroutines/CancellableContinuation$DefaultImpls {
5151
public static synthetic fun tryResume$default (Lkotlinx/coroutines/CancellableContinuation;Ljava/lang/Object;Ljava/lang/Object;ILjava/lang/Object;)Ljava/lang/Object;
5252
}
5353

54-
public class kotlinx/coroutines/CancellableContinuationImpl : kotlin/coroutines/jvm/internal/CoroutineStackFrame, kotlinx/coroutines/CancellableContinuation {
54+
public class kotlinx/coroutines/CancellableContinuationImpl : kotlin/coroutines/jvm/internal/CoroutineStackFrame, kotlinx/coroutines/CancellableContinuation, kotlinx/coroutines/channels/Waiter {
5555
public fun <init> (Lkotlin/coroutines/Continuation;I)V
5656
public final fun callCancelHandler (Lkotlinx/coroutines/CancelHandler;Ljava/lang/Throwable;)V
5757
public final fun callOnCancellation (Lkotlin/jvm/functions/Function1;Ljava/lang/Throwable;)V
@@ -854,6 +854,9 @@ public final class kotlinx/coroutines/channels/TickerMode : java/lang/Enum {
854854
public static fun values ()[Lkotlinx/coroutines/channels/TickerMode;
855855
}
856856

857+
public abstract interface class kotlinx/coroutines/channels/Waiter {
858+
}
859+
857860
public final class kotlinx/coroutines/debug/internal/DebugCoroutineInfo {
858861
public fun <init> (Lkotlinx/coroutines/debug/internal/DebugCoroutineInfoImpl;Lkotlin/coroutines/CoroutineContext;)V
859862
public final fun getContext ()Lkotlin/coroutines/CoroutineContext;
@@ -1249,7 +1252,7 @@ protected final class kotlinx/coroutines/selects/SelectImplementation$ClauseData
12491252
public final fun tryRegisterAsWaiter (Lkotlinx/coroutines/selects/SelectImplementation;)Z
12501253
}
12511254

1252-
public abstract interface class kotlinx/coroutines/selects/SelectInstance {
1255+
public abstract interface class kotlinx/coroutines/selects/SelectInstance : kotlinx/coroutines/channels/Waiter {
12531256
public abstract fun disposeOnCompletion (Lkotlinx/coroutines/DisposableHandle;)V
12541257
public abstract fun getContext ()Lkotlin/coroutines/CoroutineContext;
12551258
public abstract fun selectInRegistrationPhase (Ljava/lang/Object;)V

kotlinx-coroutines-core/build.gradle

+33-31
Original file line numberDiff line numberDiff line change
@@ -89,37 +89,37 @@ kotlin {
8989
binaries.getTest("DEBUG").freeCompilerArgs += ["-e", "kotlinx.coroutines.mainNoExit"]
9090
}
9191

92-
binaries.test("newMM", [DEBUG]) {
93-
def thisTest = it
94-
freeCompilerArgs += ["-e", "kotlinx.coroutines.mainNoExit"]
95-
optimized = true
96-
binaryOptions["memoryModel"] = "experimental"
97-
testRuns.create("newMM") {
98-
setExecutionSourceFrom(thisTest)
99-
// A hack to get different suffixes in the aggregated report.
100-
executionTask.configure { targetName = "$targetName new MM" }
101-
}
102-
}
103-
104-
binaries.test("worker", [DEBUG]) {
105-
def thisTest = it
106-
freeCompilerArgs += ["-e", "kotlinx.coroutines.mainBackground"]
107-
testRuns.create("worker") {
108-
setExecutionSourceFrom(thisTest)
109-
executionTask.configure { targetName = "$targetName worker" }
110-
}
111-
}
112-
113-
binaries.test("workerWithNewMM", [DEBUG]) {
114-
def thisTest = it
115-
optimized = true
116-
freeCompilerArgs += ["-e", "kotlinx.coroutines.mainBackground"]
117-
binaryOptions["memoryModel"] = "experimental"
118-
testRuns.create("workerWithNewMM") {
119-
setExecutionSourceFrom(thisTest)
120-
executionTask.configure { targetName = "$targetName worker with new MM" }
121-
}
122-
}
92+
// binaries.test("newMM", [DEBUG]) {
93+
// def thisTest = it
94+
// freeCompilerArgs += ["-e", "kotlinx.coroutines.mainNoExit"]
95+
// optimized = true
96+
// binaryOptions["memoryModel"] = "experimental"
97+
// testRuns.create("newMM") {
98+
// setExecutionSourceFrom(thisTest)
99+
// // A hack to get different suffixes in the aggregated report.
100+
// executionTask.configure { targetName = "$targetName new MM" }
101+
// }
102+
// }
103+
//
104+
// binaries.test("worker", [DEBUG]) {
105+
// def thisTest = it
106+
// freeCompilerArgs += ["-e", "kotlinx.coroutines.mainBackground"]
107+
// testRuns.create("worker") {
108+
// setExecutionSourceFrom(thisTest)
109+
// executionTask.configure { targetName = "$targetName worker" }
110+
// }
111+
// }
112+
//
113+
// binaries.test("workerWithNewMM", [DEBUG]) {
114+
// def thisTest = it
115+
// optimized = true
116+
// freeCompilerArgs += ["-e", "kotlinx.coroutines.mainBackground"]
117+
// binaryOptions["memoryModel"] = "experimental"
118+
// testRuns.create("workerWithNewMM") {
119+
// setExecutionSourceFrom(thisTest)
120+
// executionTask.configure { targetName = "$targetName worker with new MM" }
121+
// }
122+
// }
123123
}
124124

125125
jvm {
@@ -241,6 +241,7 @@ task jvmStressTest(type: Test, dependsOn: compileTestKotlinJvm) {
241241
systemProperty 'kotlinx.coroutines.scheduler.keep.alive.sec', '100000' // any unpark problem hangs test
242242
systemProperty 'kotlinx.coroutines.semaphore.segmentSize', '2'
243243
systemProperty 'kotlinx.coroutines.semaphore.maxSpinCycles', '10'
244+
systemProperty 'kotlinx.coroutines.bufferedChannel.segmentSize', '2'
244245
}
245246

246247
task jvmLincheckTest(type: Test, dependsOn: compileTestKotlinJvm) {
@@ -259,6 +260,7 @@ static void configureJvmForLincheck(task) {
259260
'--add-exports', 'java.base/jdk.internal.util=ALL-UNNAMED'] // in the model checking mode
260261
task.systemProperty 'kotlinx.coroutines.semaphore.segmentSize', '2'
261262
task.systemProperty 'kotlinx.coroutines.semaphore.maxSpinCycles', '1' // better for the model checking mode
263+
task.systemProperty 'kotlinx.coroutines.bufferedChannel.segmentSize', '2'
262264
}
263265

264266
// Always check additional test sets

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package kotlinx.coroutines
66

77
import kotlinx.atomicfu.*
8+
import kotlinx.coroutines.channels.Waiter
89
import kotlinx.coroutines.internal.*
910
import kotlin.coroutines.*
1011
import kotlin.coroutines.intrinsics.*
@@ -26,7 +27,7 @@ internal val RESUME_TOKEN = Symbol("RESUME_TOKEN")
2627
internal open class CancellableContinuationImpl<in T>(
2728
final override val delegate: Continuation<T>,
2829
resumeMode: Int
29-
) : DispatchedTask<T>(resumeMode), CancellableContinuation<T>, CoroutineStackFrame {
30+
) : DispatchedTask<T>(resumeMode), CancellableContinuation<T>, CoroutineStackFrame, Waiter {
3031
init {
3132
assert { resumeMode != MODE_UNINITIALIZED } // invalid mode for CancellableContinuationImpl
3233
}

0 commit comments

Comments
 (0)