예제 #1
0
 def lock(self):
     if self.locked: return 0
     rv = possem.sem_wait(self.sem)
     if rv==0: self.locked=True
     return rv
예제 #2
0
 def lock(self):
     return possem.sem_wait(self.sem)
예제 #3
0
 def lock(self):
     if self.locked: return 0
     rv = possem.sem_wait(self.sem)
     if rv == 0: self.locked = True
     return rv