Skip to content

Commit 5a14ac1

Browse files
authored
Promote CoroutineDispatcher.limitedParallelism to stable (#4135)
Fixes #3864
1 parent 259000f commit 5a14ac1

File tree

6 files changed

+0
-8
lines changed

6 files changed

+0
-8
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ public abstract class CoroutineDispatcher :
140140
* @throws IllegalArgumentException if the given [parallelism] is non-positive
141141
* @throws UnsupportedOperationException if the current dispatcher does not support limited parallelism views
142142
*/
143-
@ExperimentalCoroutinesApi
144143
public open fun limitedParallelism(parallelism: Int, name: String? = null): CoroutineDispatcher {
145144
parallelism.checkParallelism()
146145
return LimitedDispatcher(this, parallelism, name)

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

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import kotlin.jvm.*
88
*/
99
internal object Unconfined : CoroutineDispatcher() {
1010

11-
@ExperimentalCoroutinesApi
1211
override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
1312
throw UnsupportedOperationException("limitedParallelism is not supported for Dispatchers.Unconfined")
1413
}

kotlinx-coroutines-core/common/src/internal/LimitedDispatcher.kt

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ internal class LimitedDispatcher(
3434
// A separate object that we can synchronize on for K/N
3535
private val workerAllocationLock = SynchronizedObject()
3636

37-
@ExperimentalCoroutinesApi
3837
override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
3938
parallelism.checkParallelism()
4039
if (parallelism >= this.parallelism) return namedOrThis(name)

kotlinx-coroutines-core/jvm/src/scheduling/Dispatcher.kt

-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ internal object DefaultScheduler : SchedulerCoroutineDispatcher(
1111
IDLE_WORKER_KEEP_ALIVE_NS, DEFAULT_SCHEDULER_NAME
1212
) {
1313

14-
@ExperimentalCoroutinesApi
1514
override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
1615
parallelism.checkParallelism()
1716
if (parallelism >= CORE_POOL_SIZE) {
@@ -45,7 +44,6 @@ private object UnlimitedIoScheduler : CoroutineDispatcher() {
4544
DefaultScheduler.dispatchWithContext(block, BlockingContext, false)
4645
}
4746

48-
@ExperimentalCoroutinesApi
4947
override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
5048
parallelism.checkParallelism()
5149
if (parallelism >= MAX_POOL_SIZE) {
@@ -75,7 +73,6 @@ internal object DefaultIoScheduler : ExecutorCoroutineDispatcher(), Executor {
7573

7674
override fun execute(command: java.lang.Runnable) = dispatch(EmptyCoroutineContext, command)
7775

78-
@ExperimentalCoroutinesApi
7976
override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
8077
// See documentation to Dispatchers.IO for the rationale
8178
return UnlimitedIoScheduler.limitedParallelism(parallelism, name)

kotlinx-coroutines-core/native/src/Dispatchers.kt

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ internal object DefaultIoScheduler : CoroutineDispatcher() {
2727
private val unlimitedPool = newFixedThreadPoolContext(2048, "Dispatchers.IO")
2828
private val io = unlimitedPool.limitedParallelism(64) // Default JVM size
2929

30-
@ExperimentalCoroutinesApi
3130
override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
3231
// See documentation to Dispatchers.IO for the rationale
3332
return unlimitedPool.limitedParallelism(parallelism, name)

kotlinx-coroutines-core/native/src/MultithreadedDispatchers.kt

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ private class MultiWorkerDispatcher(
140140
}
141141
}
142142

143-
@ExperimentalCoroutinesApi
144143
override fun limitedParallelism(parallelism: Int, name: String?): CoroutineDispatcher {
145144
parallelism.checkParallelism()
146145
if (parallelism >= workersCount) {

0 commit comments

Comments
 (0)