thread does not exist, return -1 thread has not exited yet, return -2 otherwise, return thread’s exit code