David Glasser
08/27/2019, 4:14 AMwithContext(Dispatchers.Default) {
var x = false
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
x = true
})
println(x)
}
I understand that the three lines (var x = false
, x = true
, println(x)
) will run "one at a time" but are all the right things done with the memory model to guarantee that the write will be seen by the println, without needing to use atomics or the like?gildor
08/27/2019, 5:23 AMstreetsofboston
08/28/2019, 2:52 AMAllan Wang
08/28/2019, 2:54 AMgildor
08/28/2019, 3:28 AM