onionshare-android icon indicating copy to clipboard operation
onionshare-android copied to clipboard

Review code for thread-safety issues

Open grote opened this issue 4 years ago • 1 comments

So far, we use MutableStateFlows that get updated from Kotlin coroutines on Dispatchers.IO which maybe use several I/O threads. We should check if there's any issues with that like if we always see the latest value, if we can access the value from any thread, etc.

grote avatar Nov 08 '21 13:11 grote

This is how getter and setter are implemented: https://github.com/Kotlin/kotlinx.coroutines/blob/b231887c3214187cf7f09a74073f84383a487b71/kotlinx-coroutines-core/common/src/flow/StateFlow.kt#L309

grote avatar Nov 10 '21 13:11 grote