changeset 26356:927fa07a2ba4

lock: introduce state to keep track of inheritance This is part of a series that will allow locks to be inherited by subprocesses in limited circumstances. In upcoming patches we will refer to this state.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 24 Sep 2015 15:57:11 -0700
parents f51713b8c6fa
children 6979a1369185
files mercurial/lock.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/lock.py	Thu Sep 24 10:53:16 2015 -0700
+++ b/mercurial/lock.py	Thu Sep 24 15:57:11 2015 -0700
@@ -39,7 +39,7 @@
     _host = None
 
     def __init__(self, vfs, file, timeout=-1, releasefn=None, acquirefn=None,
-                 desc=None):
+                 desc=None, parentlock=None):
         self.vfs = vfs
         self.f = file
         self.held = 0
@@ -47,6 +47,9 @@
         self.releasefn = releasefn
         self.acquirefn = acquirefn
         self.desc = desc
+        self.parentlock = parentlock
+        self._parentheld = False
+        self._inherited = False
         self.postrelease  = []
         self.pid = os.getpid()
         self.delay = self.lock()