Reduce number of threads needed for FsWatcher

This commit is contained in:
Lucien Greathouse
2019-01-28 17:11:01 -08:00
parent 12fd9aa1ef
commit 3c0fe4d684
3 changed files with 81 additions and 53 deletions

View File

@@ -72,6 +72,18 @@ impl Imfs {
self.descend_and_read_from_disk(path)
}
pub fn remove_root(&mut self, path: &Path) {
debug_assert!(path.is_absolute());
if self.roots.get(path).is_some() {
self.remove_item(path);
if let Some(parent_path) = path.parent() {
self.unlink_child(parent_path, path);
}
}
}
pub fn path_created(&mut self, path: &Path) -> io::Result<()> {
debug_assert!(path.is_absolute());
debug_assert!(self.is_within_roots(path));