code: def get_current_thread_id(thread):
      '''
      Note: the difference from get_current_thread_id to get_thread_id is that
      for the current thread we can get the thread id while the thread.ident
      is still not set in the Thread instance.
      '''
      try:
          # Fast path without getting lock.
          tid = thread.__pydevd_id__
          if tid is None:
              # Fix for https://www.brainwy.com/tracker/PyDev/645
              # if __pydevd_id__ is None, recalculate it... also, use an heuristic
              # that gives us always the same id for the thread (using thread.ident or id(thread)).
              raise AttributeError()
      except AttributeError:
          tid = _get_or_compute_thread_id_with_lock(thread, is_current_thread=True)
  
      return tif get_current_thread_id(thread):
      '''
      Note: the difference from get_current_thread_id to get_thread_id is that
      for the current thread we can get the thread id while the thread.ident
      is still not set in the Thread instance.
      '''
      try:
          # Fast path without getting lock.
          tid = thread.__pydevd_id__
          if tid is None:
              # Fix for https://www.brainwy.com/tracker/PyDev/645
              # if __pydevd_id__ is None, recalculate it... also, use an heuristic
              # that gives us always the same id for the thread (using thread.ident or id(thread)).
              raise AttributeError()
      except AttributeError:
          tid = _get_or_compute_thread_id_with_lock(thread, is_current_thread=True)
  
      return tid
docs: Note: the difference from get_current_thread_id to get_thread_id is that
      for the current thread we can get the thread id while the thread.ident
      is still not set in the Thread instance.