Relative Content

Tag Archive for multithreadingkotlinkotlin-coroutines

Is the lock here for Kotlin’s coroutine correct?

Hi I am writing some code for using coroutine to chain a channel to a background prcess in an intellij idea plugin like the following snippet. All lines with the `~>` comment start a coroutine. Say the method update will be called in multiple thread. I am wondering if the synchronized lock work or not. It seems wrong but I don’t know if there is better way for this. Any idea? Thanks in advanced!