-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiplatform synchronization (Use kotlinx-atomicfu) #5552
Labels
iOS
necessary for iOS port
Comments
Note that kotlinx-atomicfu's API is marked as having an unstable API, i.e. may change from release to release. The functionality of the library itself can be considered stable, though, it is used by other core kotlinx libraries. I read somewhere that the maintainer(s) are working on stabilizing the API. So, it may be worth on holding off on this while there are other things to do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
synchronized
is a JVM-only API in Kotlin and as far as we know, there are no plans to change that.synchronized
is used in StreetComplete in many places in the data layer. The data layer is architecture-wise a blocking API (i.e. no coroutines, no suspending functions) and hence we can't useMutex
for threadsafe locks. (Let's not preclude that we refactor the data layer one day to be coroutine-based although it would be a considerable effort, but for now:)We need a multiplatform replacement for
synchronized
. The most obvious choice is the officialkotlinx-atomicfu
, which is however still marked as experimental, especially the locks.So, while there are other things to do in preparation of #5412, it might be better to hold off towards (at least) merging a PR that implements this (because according to one maintainer of
kotlinx-atomicfu
, they are working towards stabilization)The text was updated successfully, but these errors were encountered: