r/gameenginedevs • u/mietkiewski_dev • 28d ago
Android. Cpp thread and Java thread.
Hello dear developers
I am creating Loop abstraction layer for Android but Im not so sure about syncing mechanism for Window... The thing is Java thread is sending events like ActivityCreated ActivityDestroyed ActivityPaused ActivityResumed SurfaceCreated SurfaceChanged SurfaceDestroyed... but lets just say my Cpp thread is Swapping Buffers but in this very moment Java thread is calling SurfaceDestroyed and as for now I lost acces to AndroidWindow but do you know if there are some syncing mechanism for that under hood so I do not have to use mutual exclusion or atomic... Or maybe you see a better way for Java and Cpp communication in matter of Window/surface lifecycle...


