In kotlin/native, how would I create a frozen reference to a mutable object to read changes across threads?
Basically, my front-end is a block editor similar to the Unreal Event Editor, and the back-end has a thread using the configuration from that editor in real-time. However, I can't use the MutableList of nodes I have since either it's not frozen and can't be shared, or it's frozen but then the front-end can't make any changes.
I also considered stopping and restarting the backend thread, but since a frozen object can't be un-frozen, that's also not an option.
I've tried doing some more hacky stuff with creating a COpaquePointer and pulling it from that, to avoid it from being frozen, but that still made the object exist in two threads and crash.
I'd really like to know how to solve this, since I much prefer kotlin over C++ (where I did get this concept working).