Changeset d70671084c48…
Parent 3f29cde12204…
by
Changes to one file · Browse files at d70671084c48 Showing diff from parent 3f29cde12204 Diff from another changeset...
@@ -10,6 +10,7 @@ from mercurial import hg, cmdutil, util
import thgutil
import sys
+import threading
try:
from mercurial.error import RepoError
@@ -38,6 +39,8 @@cache_root = None
cache_pdir = None
+cache_lock = threading.Semaphore()
+
# some misc constants
S_OK = 0
S_FALSE = 1
@@ -198,12 +201,15 @@ return status
def IsMemberOf(self, path, attrib):
+ global cache_lock
try:
+ cache_lock.acquire()
tc = win32api.GetTickCount()
if self._get_state(path) == self.state:
return S_OK
return S_FALSE
finally:
+ cache_lock.release()
print "IsMemberOf(%s): _get_state() took %d ticks" % \
(self.state, win32api.GetTickCount() - tc)
|
Loading...