def resolve(self, name):
    with self.resp:
        if (self.snl is None):
            return None
        log.debug("resolve service name '{0}'".format(name))
        try:
            return self.snl[name]
        except KeyError:
            pass
        tid = random.choice(self.tids)
        self.tids.remove(tid)
        self.sdreq.append((tid, name))
        while ((not (self.snl is None)) and (not (name in self.snl))):
            self.resp.wait()
        return (None if (self.snl is None) else self.snl[name])
def resolve(self, name):
    with self.resp:
        if (self.snl is None):
            return None
        log.debug("resolve service name '{0}'".format(name))
        try:
            return self.snl[name]
        except KeyError:
            pass
        tid = random.choice(self.tids)
        self.tids.remove(tid)
        self.sdreq.append((tid, name))
        while ((not (self.snl is None)) and (not (name in self.snl))):
            self.resp.wait()
        return (None if (self.snl is None) else self.snl[name])