Skip to content

Commit 6c418ea

Browse files
committed
Reduce the visibility of some API endpoints
1 parent 7bed717 commit 6c418ea

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -672,3 +672,9 @@ public object NonDisposableHandle : DisposableHandle, ChildHandle {
672672
*/
673673
override fun toString(): String = "NonDisposableHandle"
674674
}
675+
676+
private class DisposeOnCompletion(
677+
private val handle: DisposableHandle
678+
) : JobNode() {
679+
override fun invoke(cause: Throwable?) = handle.dispose()
680+
}

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

+3-10
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ public open class JobSupport constructor(active: Boolean) : Job, ChildJob, Paren
145145
return
146146
}
147147
parent.start() // make sure the parent is started
148-
@Suppress("DEPRECATION")
149148
val handle = parent.attachChild(this)
150149
parentHandle = handle
151150
// now check our state _after_ registering (see tryFinalizeSimpleState order of actions)
@@ -1182,7 +1181,7 @@ public open class JobSupport constructor(active: Boolean) : Job, ChildJob, Paren
11821181
return parent.getCancellationException()
11831182
}
11841183

1185-
protected override fun nameString(): String =
1184+
override fun nameString(): String =
11861185
"AwaitContinuation"
11871186
}
11881187

@@ -1379,7 +1378,7 @@ internal class NodeList : LockFreeLinkedListHead(), Incomplete {
13791378
if (DEBUG) getString("Active") else super.toString()
13801379
}
13811380

1382-
internal class InactiveNodeList(
1381+
private class InactiveNodeList(
13831382
override val list: NodeList
13841383
) : Incomplete {
13851384
override val isActive: Boolean get() = false
@@ -1415,12 +1414,6 @@ private class ResumeAwaitOnCompletion<T>(
14151414
}
14161415
}
14171416

1418-
internal class DisposeOnCompletion(
1419-
private val handle: DisposableHandle
1420-
) : JobNode() {
1421-
override fun invoke(cause: Throwable?) = handle.dispose()
1422-
}
1423-
14241417
// -------- invokeOnCancellation nodes
14251418

14261419
/**
@@ -1439,7 +1432,7 @@ private class InvokeOnCancelling(
14391432
}
14401433
}
14411434

1442-
internal class ChildHandleNode(
1435+
private class ChildHandleNode(
14431436
@JvmField val childJob: ChildJob
14441437
) : JobCancellingNode(), ChildHandle {
14451438
override val parent: Job get() = job

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

-8
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ public abstract class OpDescriptor {
1919
*/
2020
abstract fun perform(affected: Any?): Any?
2121

22-
/**
23-
* Returns reference to atomic operation that this descriptor is a part of or `null`
24-
* if not a part of any [AtomicOp].
25-
*/
26-
abstract val atomicOp: AtomicOp<*>?
27-
2822
override fun toString(): String = "$classSimpleName@$hexAddress" // debug
2923
}
3024

@@ -46,8 +40,6 @@ internal val NO_DECISION: Any = Symbol("NO_DECISION")
4640
public abstract class AtomicOp<in T> : OpDescriptor() {
4741
private val _consensus = atomic<Any?>(NO_DECISION)
4842

49-
override val atomicOp: AtomicOp<*> get() = this
50-
5143
private fun decide(decision: Any?): Any? {
5244
assert { decision !== NO_DECISION }
5345
val current = _consensus.value

0 commit comments

Comments
 (0)