Return thread id

def get_thread_id(self):
        """Return thread id"""
        if self._id is None:
            for thread_id, obj in list(threading._active.items()):
                if obj is self:
                    self._id = thread_id
        return self._id