Now that all singleton objects are frozen/read-onl...
# kotlin-native
t
Now that all singleton objects are frozen/read-only since Kotlin/Native 0.8, how can I put a shared MutableHashMap in a companion object? Do I have to use an AtomicReference<HashMap> and copy the whole thing for every update? (There is only one thread in my app.)
t
Maybe @ThreadLocal can help you?
t
Aha! Yes, marking the object as
@ThreadLocal
seems to do the trick. Thanks.