onExit

open fun onExit(thread: Job)

Invoked when a Thread terminates or starting it fails.

For a platform thread, this method is invoked by the thread itself when it terminates. For a virtual thread, this method is invoked on its carrier after the virtual thread has terminated.

If starting the Thread failed then this method is invoked on the thread that invoked onStart.