(before the start() method returns).
"""
- __slots__ = ('lock_obj', 'path',) + \
- ('_files', '_force_dummy',
+ __slots__ = ('path',) + \
+ ('_files', '_force_dummy', '_lock_obj',
'_thread', '_reg_id',)
def _start(self):
self._thread.start()
def _run_lock(self):
- self.lock_obj = lockfile(self.path, wantnewlockfile=True)
+ self._lock_obj = lockfile(self.path, wantnewlockfile=True)
self._files['pipe_write'].write(b'\0')
def _output_handler(self, f, event):
return self.returncode
def unlock(self):
- if self.lock_obj is None:
+ if self._lock_obj is None:
raise AssertionError('not locked')
if self.returncode is None:
raise AssertionError('lock not acquired yet')
- unlockfile(self.lock_obj)
- self.lock_obj = None
+ unlockfile(self._lock_obj)
+ self._lock_obj = None
def _unregister(self):
self._registered = False