code: def __cleanup_thread(self, event):
          
          tid = event.get_tid()
  
          # Cleanup running breakpoints
          try:
              for bp in self.__runningBP[tid]:
                  self.__cleanup_breakpoint(event, bp)
              del self.__runningBP[tid]
          except KeyError:
              pass
  
          # Cleanup hardware breakpoints
          try:
              for bp in self.__hardwareBP[tid]:
                  self.__cleanup_breakpoint(event, bp)
              del self.__hardwareBP[tid]
          except KeyError:
              pass
  
          # Cleanup set of threads being traced
          if tid in self.__tracing:
              self.__tracing.remove(tid)
docs: Auxiliary method for L{_notify_exit_thread}
          and L{_notify_exit_process}.