Skip to content

Commit 18a61e9

Browse files
committed
~ length -> currentLength
1 parent 752aa8c commit 18a61e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

kotlinx-coroutines-core/jvm/src/internal/ResizableAtomicArray.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ internal class ResizableAtomicArray<T>(initialLength: Int) {
1515
@Volatile
1616
private var array = AtomicReferenceArray<T>(initialLength)
1717

18-
public fun length(): Int = array.length()
18+
// for debug output
19+
public fun currentLength(): Int = array.length()
1920

2021
public operator fun get(index: Int): T? {
2122
assert { index >= 0 }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ internal class CoroutineScheduler(
524524
var dormant = 0
525525
var terminated = 0
526526
val queueSizes = arrayListOf<String>()
527-
for (index in 1 until workers.length()) {
527+
for (index in 1 until workers.currentLength()) {
528528
val worker = workers[index] ?: continue
529529
val queueSize = worker.localQueue.size
530530
when (worker.state) {

0 commit comments

Comments
 (0)