Check that the thread_id is not the same as the joinable thread_id before calling join