Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/olpc/datastore/backingstore.py
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-31 21:25:40 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-31 21:25:40 (GMT)
commit19c87943f135a4e3255b823c6f2dc2ffdebb39d2 (patch)
tree6daba8d0c0531cdeef568cdcf49af210a004960c /src/olpc/datastore/backingstore.py
parent356b35a278f2969c333c8c7b85ae8ae35ebe0141 (diff)
force shutdown on unmount (for USB drives)
this now ignores pending work, finishes only its current task and returns should help with the DBus timeout in umount though the caller should call this async I think. normally you'd want to know that the media was stable before pulling the key, w/o notification or a sync call you can't know.
Diffstat (limited to 'src/olpc/datastore/backingstore.py')
-rw-r--r--src/olpc/datastore/backingstore.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/olpc/datastore/backingstore.py b/src/olpc/datastore/backingstore.py
index 724e7cc..2956811 100644
--- a/src/olpc/datastore/backingstore.py
+++ b/src/olpc/datastore/backingstore.py
@@ -470,6 +470,7 @@ class InplaceFileBackingStore(FileBackingStore):
# now map/update the existing data into the indexes
# but do it async
self.walker = threading.Thread(target=self._walk)
+ self._runWalker = True
self.walker.setDaemon(True)
self.walker.start()
@@ -489,6 +490,8 @@ class InplaceFileBackingStore(FileBackingStore):
for fn in filenames:
+ # give the thread a chance to exit
+ if not self._runWalker: break
# blacklist files
# ignore conventionally hidden files
if fn.startswith("."): continue
@@ -587,8 +590,9 @@ class InplaceFileBackingStore(FileBackingStore):
def stop(self):
if self.walker and self.walker.isAlive():
- self.walker.join()
- self.indexmanager.stop()
+ # XXX: just force the unmount, flush the index queue
+ self._runWalker = False
+ self.indexmanager.stop(force=True)
def complete_indexing(self):
if self.walker and self.walker.isAlive():