Checking the Completion State
You can use the completion state value returned from the start() function to determine whether or not the runnable ran to completion. The start() function returns the following completion states:
*RW_THR_NORMAL if the runnable ran to completion.
*RW_THR_FAILED if an exception was produced.
*RW_THR_CANCELED if the runnable was canceled by another thread.
The code fragment in Example 4 shows how to check for completion states.
Example 4 – Checking a runnable’s completion state
switch(runnable.start()) {
case RW_THR_NORMAL:
// The runnable ran to completion
...
break;
case RW_THR_FAILED:
// The runnable exited with an exception
...
break;
case RW_THR_CANCELED:
// The runnable was canceled during execution
...
break;
}