<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _try_join_cancelled_thread(thread):
 """Join a thread, but if the thread doesn't terminate for some time, ignore it instead of waiting infinitely."""

    thread.join(10)
    if thread.is_alive():
        logging.warning("Thread %s did not terminate within grace period after cancellation",
                        thread.name)