-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
2 - S (<= 1 week)
-
5966
-
Not Needed
On JVM platforms we need a way to attach the Sync Client C++ thread to Java in order to communicate with it and detach it afterward in order to correctly shut down the JVM. Realm Kotlin accidentally did attach it in some other code, but detaching is currently impossible.
In ObjectStore this global variable exists https://github.com/realm/realm-core/blob/master/src/realm/object-store/binding_callback_thread_observer.hpp#L39, which is being used by the Java SDK here with implementation here
We need a similar mechanism in the C-API in order to correctly clean up when closing Realms and Apps in Realm Kotlin.
Note, the current behavior in ObjectStore is a bit suboptimal since the same callback is used across all apps, so having a callback that is scoped to a single app would be ideal. But the current implementation is enough for our current use case.
- is related to
-
RCORE-1541 [C-API] Callbacks to attach and detach core threads to SDK runtimes
- Investigate