equal
deleted
inserted
replaced
81 self.held += 1 |
81 self.held += 1 |
82 return |
82 return |
83 if lock._host is None: |
83 if lock._host is None: |
84 lock._host = socket.gethostname() |
84 lock._host = socket.gethostname() |
85 lockname = '%s:%s' % (lock._host, self.pid) |
85 lockname = '%s:%s' % (lock._host, self.pid) |
86 while not self.held: |
86 retry = 5 |
|
87 while not self.held and retry: |
|
88 retry -= 1 |
87 try: |
89 try: |
88 self.vfs.makelock(lockname, self.f) |
90 self.vfs.makelock(lockname, self.f) |
89 self.held = 1 |
91 self.held = 1 |
90 except (OSError, IOError) as why: |
92 except (OSError, IOError) as why: |
91 if why.errno == errno.EEXIST: |
93 if why.errno == errno.EEXIST: |