Skip to content

Commit cb79909

Browse files
committed
Reduce the visibility of some API endpoints
1 parent 605ec56 commit cb79909

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
@@ -682,3 +682,9 @@ public object NonDisposableHandle : DisposableHandle, ChildHandle {
682682
*/
683683
override fun toString(): String = "NonDisposableHandle"
684684
}
685+
686+
private class DisposeOnCompletion(
687+
private val handle: DisposableHandle
688+
) : JobNode() {
689+
override fun invoke(cause: Throwable?) = handle.dispose()
690+
}

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

+3-10
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ public open class JobSupport constructor(active: Boolean) : Job, ChildJob, Paren
148148
return
149149
}
150150
parent.start() // make sure the parent is started
151-
@Suppress("DEPRECATION")
152151
val handle = parent.attachChild(this)
153152
parentHandle = handle
154153
// now check our state _after_ registering (see tryFinalizeSimpleState order of actions)
@@ -1175,7 +1174,7 @@ public open class JobSupport constructor(active: Boolean) : Job, ChildJob, Paren
11751174
return parent.getCancellationException()
11761175
}
11771176

1178-
protected override fun nameString(): String =
1177+
override fun nameString(): String =
11791178
"AwaitContinuation"
11801179
}
11811180

@@ -1372,7 +1371,7 @@ internal class NodeList : LockFreeLinkedListHead(), Incomplete {
13721371
if (DEBUG) getString("Active") else super.toString()
13731372
}
13741373

1375-
internal class InactiveNodeList(
1374+
private class InactiveNodeList(
13761375
override val list: NodeList
13771376
) : Incomplete {
13781377
override val isActive: Boolean get() = false
@@ -1408,12 +1407,6 @@ private class ResumeAwaitOnCompletion<T>(
14081407
}
14091408
}
14101409

1411-
internal class DisposeOnCompletion(
1412-
private val handle: DisposableHandle
1413-
) : JobNode() {
1414-
override fun invoke(cause: Throwable?) = handle.dispose()
1415-
}
1416-
14171410
// -------- invokeOnCancellation nodes
14181411

14191412
/**
@@ -1432,7 +1425,7 @@ private class InvokeOnCancelling(
14321425
}
14331426
}
14341427

1435-
internal class ChildHandleNode(
1428+
private class ChildHandleNode(
14361429
@JvmField val childJob: ChildJob
14371430
) : JobCancellingNode(), ChildHandle {
14381431
override val parent: Job get() = job

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

-8
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ public abstract class OpDescriptor {
2222
*/
2323
abstract fun perform(affected: Any?): Any?
2424

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

@@ -49,8 +43,6 @@ internal val NO_DECISION: Any = Symbol("NO_DECISION")
4943
public abstract class AtomicOp<in T> : OpDescriptor() {
5044
private val _consensus = atomic<Any?>(NO_DECISION)
5145

52-
override val atomicOp: AtomicOp<*> get() = this
53-
5446
private fun decide(decision: Any?): Any? {
5547
assert { decision !== NO_DECISION }
5648
val current = _consensus.value

0 commit comments

Comments
 (0)