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.
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.