def __init__(self, service=rpc_gss_svc_none): t = threading.currentThread() self.lock = threading.Lock() self.gss_seq_num = 0 self.init = 1 self.service = service self._packer = {t: gss_pack.GSSPacker()} self._unpacker = {t: gss_pack.GSSUnpacker('')}
def getunpacker(self): t = threading.currentThread() self.lock.acquire() if t in self._unpacker: out = self._unpacker[t] else: self._packer[t] = gss_pack.GSSPacker() out = self._unpacker[t] = gss_pack.GSSUnpacker('') self.lock.release() return out