Thread Join and Cancellation
pthread_join(ThreadId, &Status) makes a thread wait for the thread specified in the ThreadId.
Pthread_cancel(ThreadId); cancels the thread specified by ThreadId. Any thread can cancel any other thread. There is no need for any relationship for cancellation.