File tree 7 files changed +30
-13
lines changed
main/kotlin/kotlinx/coroutines/experimental
kotlinx-coroutines-javafx/src/test/kotlin/examples
kotlinx-coroutines-jdk8/src/test/kotlin/examples
kotlinx-coroutines-nio/src/test/kotlin/examples
kotlinx-coroutines-swing/src/test/kotlin/examples
7 files changed +30
-13
lines changed Original file line number Diff line number Diff line change 14
14
15
15
<name >Kotlin coroutines core library</name >
16
16
17
+ <properties >
18
+ <kotlin .compiler.jdkHome>${env.JDK_16} </kotlin .compiler.jdkHome>
19
+ </properties >
20
+
17
21
<build >
18
22
<sourceDirectory >src/main/kotlin</sourceDirectory >
19
23
<testSourceDirectory >src/test/kotlin</testSourceDirectory >
24
+
25
+ <plugins >
26
+ <plugin >
27
+ <artifactId >maven-surefire-plugin</artifactId >
28
+ <configuration >
29
+ <forkMode >once</forkMode >
30
+ <jvm >${env.JDK_16} /bin/java</jvm >
31
+ </configuration >
32
+ </plugin >
33
+ </plugins >
20
34
</build >
21
35
</project >
Original file line number Diff line number Diff line change @@ -2,15 +2,14 @@ package kotlinx.coroutines.experimental
2
2
3
3
import java.util.concurrent.Executor
4
4
import java.util.concurrent.Executors
5
- import java.util.concurrent.ForkJoinPool
6
5
import java.util.concurrent.atomic.AtomicInteger
7
6
import kotlin.coroutines.CoroutineContext
8
7
9
8
/* *
10
9
* Represents common pool of shared threads as coroutine dispatcher for compute-intensive tasks.
11
- * It uses [ForkJoinPool] when available, which implements efficient work-stealing algorithm for its queues, so every
10
+ * It uses [java.util.concurrent. ForkJoinPool] when available, which implements efficient work-stealing algorithm for its queues, so every
12
11
* coroutine resumption is dispatched as a separate task even when it already executes inside the pool.
13
- * When available, it wraps [ ForkJoinPool.commonPool] and provides a similar shared pool where not.
12
+ * When available, it wraps ` ForkJoinPool.commonPool` and provides a similar shared pool where not.
14
13
*/
15
14
object CommonPool : CoroutineDispatcher() {
16
15
private val pool: Executor = findPool()
Original file line number Diff line number Diff line change 1
1
package examples
2
2
3
- import java.time.Instant
3
+ import java.text.SimpleDateFormat
4
+ import java.util.*
4
5
5
- fun log (msg : String ) = println (" ${Instant .now( )} [${Thread .currentThread().name} ] $msg " )
6
+ fun log (msg : String ) = println (" ${SimpleDateFormat ( " YYYYMMdd-HHmmss.sss " ).format( Date () )} [${Thread .currentThread().name} ] $msg " )
Original file line number Diff line number Diff line change @@ -15,14 +15,14 @@ import kotlinx.coroutines.experimental.Job
15
15
import kotlinx.coroutines.experimental.delay
16
16
import kotlinx.coroutines.experimental.javafx.JavaFx
17
17
import kotlinx.coroutines.experimental.launch
18
- import java.time.Instant
18
+ import java.text.SimpleDateFormat
19
19
import java.util.*
20
20
21
21
fun main (args : Array <String >) {
22
22
Application .launch(FxTestApp ::class .java, * args)
23
23
}
24
24
25
- fun log (msg : String ) = println (" ${Instant .now( )} [${Thread .currentThread().name} ] $msg " )
25
+ fun log (msg : String ) = println (" ${SimpleDateFormat ( " YYYYMMdd-HHmmss.sss " ).format( Date () )} [${Thread .currentThread().name} ] $msg " )
26
26
27
27
class FxTestApp : Application () {
28
28
val buttons = FlowPane ().apply {
Original file line number Diff line number Diff line change 1
1
package examples
2
2
3
- import java.time.Instant
3
+ import java.text.SimpleDateFormat
4
+ import java.util.*
4
5
5
- fun log (msg : String ) = println (" ${Instant .now( )} [${Thread .currentThread().name} ] $msg " )
6
+ fun log (msg : String ) = println (" ${SimpleDateFormat ( " YYYYMMdd-HHmmss.sss " ).format( Date () )} [${Thread .currentThread().name} ] $msg " )
Original file line number Diff line number Diff line change 1
1
package examples
2
2
3
- import java.time.Instant
3
+ import java.text.SimpleDateFormat
4
+ import java.util.*
4
5
5
- fun log (msg : String ) = println (" ${Instant .now( )} [${Thread .currentThread().name} ] $msg " )
6
+ fun log (msg : String ) = println (" ${SimpleDateFormat ( " YYYYMMdd-HHmmss.sss " ).format( Date () )} [${Thread .currentThread().name} ] $msg " )
Original file line number Diff line number Diff line change @@ -2,11 +2,12 @@ package examples
2
2
3
3
import kotlinx.coroutines.experimental.runBlocking
4
4
import kotlinx.coroutines.experimental.swing.Swing
5
- import java.time.Instant
5
+ import java.text.SimpleDateFormat
6
+ import java.util.*
6
7
import java.util.concurrent.ForkJoinPool
7
8
import kotlin.coroutines.suspendCoroutine
8
9
9
- fun log (msg : String ) = println (" ${Instant .now( )} [${Thread .currentThread().name} ] $msg " )
10
+ fun log (msg : String ) = println (" ${SimpleDateFormat ( " YYYYMMdd-HHmmss.sss " ).format( Date () )} [${Thread .currentThread().name} ] $msg " )
10
11
11
12
suspend fun makeRequest (): String {
12
13
log(" Making request..." )
You can’t perform that action at this time.
0 commit comments