示例#1
0
文件: lock.py 项目: yili9111/mapproxy
 def _try_lock(self):
     tries = 0
     i = random.randint(0, self.n-1)
     while True:
         tries += 1
         try:
             return LockFile(self.lock_file + str(i))
         except LockError:
             if tries >= self.n:
                 raise
         i = (i+1) % self.n
示例#2
0
 def _try_lock(self):
     return LockFile(self.lock_file)