code: def prepare_threads(new_function):
      
      with _waitforthreads_lock:
          if hasattr(threading, 'get_ident'):
              old_function = threading.get_ident
              threading.get_ident = new_function
          else:
              old_function = threading._get_ident
              threading._get_ident = new_function
  
          return old_function
docs: Replaces threading._get_ident() function in order to notify
      the waiting Condition.