阅读背景:

Kotlin 协程 不安全的并发/安全的并发

来源:互联网 
class CoroutineText03 {

    @Test
    fun `test not safe concurrent`() = runBlocking<Unit> {
        var count = 0
        List(1000) {
            GlobalScope.launch { count++ }
        }.joinAll()
        println(count)


    }


}class CoroutineText03 {

    @Test
    fun `



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: