File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
kotlinx-coroutines-core/src/test/kotlin/guide Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ fun main(args: Array<String>) = runBlocking<Unit> {
796796 val jobs = arrayListOf<Job >()
797797 jobs + = launch(Unconfined ) { // not confined -- will work with main thread
798798 println (" 'Unconfined': I'm working in thread ${Thread .currentThread().name} " )
799- delay(1000 )
799+ delay(500 )
800800 println (" 'Unconfined': After delay in thread ${Thread .currentThread().name} " )
801801 }
802802 jobs + = launch(context) { // context of the parent, runBlocking coroutine
@@ -808,7 +808,7 @@ fun main(args: Array<String>) = runBlocking<Unit> {
808808}
809809```
810810
811- > You can get full code [ here] ( kotlinx-coroutines-core/src/test/kotlin/guide/example-contest -02.kt )
811+ > You can get full code [ here] ( kotlinx-coroutines-core/src/test/kotlin/guide/example-context -02.kt )
812812
813813Produces the output:
814814
Original file line number Diff line number Diff line change 1515 */
1616
1717// This file was automatically generated from coroutines-guide.md by Knit tool. Do not edit.
18- package guide.contest .example02
18+ package guide.context .example02
1919
2020import kotlinx.coroutines.experimental.*
2121
2222fun main (args : Array <String >) = runBlocking<Unit > {
2323 val jobs = arrayListOf<Job >()
2424 jobs + = launch(Unconfined ) { // not confined -- will work with main thread
2525 println (" 'Unconfined': I'm working in thread ${Thread .currentThread().name} " )
26- delay(1000 )
26+ delay(500 )
2727 println (" 'Unconfined': After delay in thread ${Thread .currentThread().name} " )
2828 }
2929 jobs + = launch(context) { // context of the parent, runBlocking coroutine
Original file line number Diff line number Diff line change @@ -167,8 +167,8 @@ class GuideTest {
167167 }
168168
169169 @Test
170- fun testGuideContestExample02 () {
171- test { guide.contest .example02.main(emptyArray()) }.verifyLinesStart(
170+ fun testGuideContextExample02 () {
171+ test { guide.context .example02.main(emptyArray()) }.verifyLinesStart(
172172 " 'Unconfined': I'm working in thread main" ,
173173 " 'context': I'm working in thread main" ,
174174 " 'Unconfined': After delay in thread kotlinx.coroutines.ScheduledExecutor" ,
You can’t perform that action at this time.
0 commit comments