-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate channels and related operators to common, so channels can be …
…used from JS Fixes #201
- Loading branch information
Showing
50 changed files
with
711 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,4 +80,3 @@ public open class ConflatedChannel<E> : AbstractChannel<E>() { | |
} | ||
} | ||
} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
...-core-common/src/main/kotlin/kotlinx/coroutines/experimental/internal/ArrayCopy.common.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package kotlinx.coroutines.experimental.internal | ||
|
||
/** | ||
* Cross-platform array copy. Overlaps of source and destination are not supported | ||
*/ | ||
expect fun <E> arraycopy(source: Array<E>, srcPos: Int, destination: Array<E?>, destinationStart: Int, length: Int) |
5 changes: 5 additions & 0 deletions
5
...-core-common/src/main/kotlin/kotlinx/coroutines/experimental/internal/Closeable.common.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package kotlinx.coroutines.experimental.internal | ||
|
||
expect interface Closeable { | ||
fun close() | ||
} |
18 changes: 18 additions & 0 deletions
18
...core-common/src/main/kotlin/kotlinx/coroutines/experimental/internal/Concurrent.common.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package kotlinx.coroutines.experimental.internal | ||
|
||
/** | ||
* Special kind of list intended to be used as collection of subscribers in [ArrayBroadcastChannel] | ||
* On JVM it's CopyOnWriteList and on JS it's MutableList. | ||
* | ||
* Note that this alias is intentionally not named as CopyOnWriteList to avoid accidental misusage outside of ArrayBroadcastChannel | ||
*/ | ||
typealias SubscribersList<E> = MutableList<E> | ||
|
||
expect fun <E> subscriberList(): SubscribersList<E> | ||
|
||
expect class ReentrantLock() { | ||
fun tryLock(): Boolean | ||
fun unlock(): Unit | ||
} | ||
|
||
expect inline fun <T> ReentrantLock.withLock(action: () -> T): T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.