def lock(self): if self.locked: return 0 rv = possem.sem_wait(self.sem) if rv==0: self.locked=True return rv
def lock(self): return possem.sem_wait(self.sem)
def lock(self): if self.locked: return 0 rv = possem.sem_wait(self.sem) if rv == 0: self.locked = True return rv