exitApp

Gracefully exits the enclosing SuspendApp with process exit status code.

This signals SuspendApp to complete with the given process exit status, while allowing resource finalizers to run before SuspendApp exits the process. On Unix-like systems, this status is reported to the parent process or shell; 0 conventionally denotes success, and non-zero values denote failure or application-specific outcomes.

To be used as a replacement for System.exit(code) and for kotlin.system.exitProcess(code), which are unsafe to use in a coroutines-driven main, leading to deadlocks.

Parameters

code

the exit status of the process.