Skip to content

Commit fac4860

Browse files
committed
Fixed code after merge of 'develop' with TestCoroutineContext
* Moved 'kotlinx-coroutines-test' to a new root folder * Removed ThreadSafeHead duplication by promoting it core's internal class to public @InternalCoroutinesApi
1 parent d39ffed commit fac4860

13 files changed

+18
-173
lines changed

core/kotlinx-coroutines-test/src/internal/Synchronized.kt

-11
This file was deleted.

core/kotlinx-coroutines-test/src/internal/ThreadSafeHeap.kt

-153
This file was deleted.

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

+11-4
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,28 @@
44

55
package kotlinx.coroutines.internal
66

7+
import kotlinx.coroutines.*
78
import java.util.*
89

9-
internal interface ThreadSafeHeapNode {
10+
/**
11+
* @suppress **This an internal API and should not be used from general code.**
12+
*/
13+
@InternalCoroutinesApi
14+
public interface ThreadSafeHeapNode {
1015
public var heap: ThreadSafeHeap<*>?
1116
public var index: Int
1217
}
1318

1419
/**
1520
* Synchronized binary heap.
21+
* @suppress **This an internal API and should not be used from general code.**
1622
*/
17-
internal class ThreadSafeHeap<T> : SynchronizedObject() where T: ThreadSafeHeapNode, T: Comparable<T> {
23+
@InternalCoroutinesApi
24+
public class ThreadSafeHeap<T> : SynchronizedObject() where T: ThreadSafeHeapNode, T: Comparable<T> {
1825
private var a: Array<T?>? = null
1926

20-
@JvmField @PublishedApi @Volatile
21-
internal var size = 0
27+
@JvmField @Volatile
28+
public var size = 0
2229

2330
public val isEmpty: Boolean get() = size == 0
2431

core/kotlinx-coroutines-test/src/TestCoroutineDispatcher.kt renamed to kotlinx-coroutines-test/src/TestCoroutineDispatcher.kt

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
package kotlinx.coroutines.test
26

37
import kotlinx.coroutines.*
4-
import kotlinx.coroutines.test.internal.ThreadSafeHeap
5-
import kotlinx.coroutines.test.internal.ThreadSafeHeapNode
6-
import java.util.concurrent.atomic.AtomicLong
7-
import kotlin.coroutines.CoroutineContext
8-
import kotlin.math.max
8+
import kotlinx.coroutines.internal.*
9+
import java.util.concurrent.atomic.*
10+
import kotlin.coroutines.*
911

1012
/**
1113
* Control the virtual clock time of a [CoroutineDispatcher].

0 commit comments

Comments
 (0)