implement get_thread_from_tid.