Has there been a change in Kotlin/Natives concurre...
# kotlin-native
t
Has there been a change in Kotlin/Natives concurrency model regarding reference counting? I am going through the examples from https://touchlab.co/kotlin-native-stranger-threads-ep-1/ and realized that this test is failing since no exception is thrown. So there is no need to freeze the
holder
đŸ¤”
Copy code
class ArgHolder(var arg: JobArg?) {
        fun getAndClear(): JobArg {
            val temp = arg!!
            arg = null
            return temp
        }
    }

    @Test
    fun stillVisible() {
        val holder = ArgHolder(JobArg("Hi"))

        assertFails {
            worker.execute(TransferMode.SAFE, { holder.getAndClear() }) {
                print(it)
            }
        }
    }
k
Not sure. There haven't been any significant changes, but that post is getting old
It’s possible that’s something that’s improved. In theory that should work, but was failing when I wrote it. The output of the compiler may have improved.
Also, OMG, I have an ongoing battle with the internal team around the website format. It’s very frustrating. The same post is on medium and far more readable: https://medium.com/@kpgalligan/kotlin-native-stranger-threads-ep-1-1ccccdfe0c99