projectNEWM / newm-server

Backend components for mobile apps and the artist portal.
Apache License 2.0
10 stars 5 forks source link

Ensure proper threads for InterProcessMutex #552

Closed AndrewWestberg closed 2 weeks ago

AndrewWestberg commented 2 weeks ago

The way coroutines work, it's possible to resume on a different thread after a suspend function. This creates an extension function so we can use InterProcessMutex with coroutines to ensure we resume on the same physical JVM thread. This allows us to confidently release() the interprocess mutex since it will be acquired and released on the same physical JVM thread.