def Acquire(self): while not self.isFinish() and self.GetVersion() % self.mod != self.res: pass if self.isFinish(): return None AcquireMemory(self.m_id) return self.m_obj
def __enter__(self): # print('enter') while self.GetVersion() % self.mod != self.res: pass AcquireMemory(self.m_id) return self.m_obj