If you wanted to be tighter about it, you could check that it only fails with the error code designated for the already-exited-but-joinable case. But pthread_cancel return values is not what the test is about, so the change you sent is fine as is. Thanks, Roland