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