User threads and processes have “exit information”. When a thread or process terminates the reason for the termination is found in the exit information. For example, a panic will store the panic category and reason in the exit information. Exit information has three parts: the exit type, exit reason and exit category.
Exit type is defined by the TExitType enum.
When a thread or process is created, its exit type is set to 3. An exit type of 3 indicates that the thread is still active, though not necessarily running. If the thread terminates for any reason, then the exit type is changed to reflect the cause of the exit.
Once the thread or process has exited, the exit reason and exit type fields will contain useful information. The contents depends on the type of exit.
Note that if the main thread in a process exits, then the process will exit with the same exit information as the thread.
if RThread::Terminate() or RProcess::Terminate() is called, then the exit category is Terminate, and the exit reason is the value of the aReason argument passed to these functions.
If RThread::Kill() or RProcess::Kill() is called, then the exit category is Kill, and the exit reason is the value of the aReason argument passed to these functions.
If a thread panics, then the exit category is panic, and the exit reason is the panic number. For example a USER-19 panic would give the following exit information:
exit type = 2
exit category = “USER”
exit reason = 19