Test the same_thread check.