Hi.. I have no idea why am I having this error in ...
# coroutines
w
Hi.. I have no idea why am I having this error in commonNativeTest
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.HashMap@dac14b48
Basically I have a static hashmap to serve caching purposes, since KMP doesn’t have a ConcurrentHashMap -yet, right?- I’m testing using a normal hashmap and reentrantLock() from kotlinx.atomicfu, the hashmap is static - in companion object{} - it always fails in native when you try to put something in it
l
You need to learn about the current Kotlin/Native memory model where things are shared XOR mutable, except for atomic references holding immutable objects.
👍 1
This is unrelated to coroutines BTW
💯 1