mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-04 16:56:59 +01:00
added parking_lot mutex
This commit is contained in:
1 parent
38aca3cd48
commit
d58dc46708
11 files changed
+203
-197
No files matched your search
@@ -93,7 +93,7 @@ pub fn scan(
|
||||
!matches!(entry.file_name().to_str(), Some(name) if SKIP_DIRS.contains(&name))
|
||||
});
|
||||
|
||||
let state = std::sync::Mutex::new(SinkState {
|
||||
let state = parking_lot::Mutex::new(SinkState {
|
||||
buf: Vec::with_capacity(BATCH),
|
||||
total: 0,
|
||||
sink,
|
||||
@@ -112,7 +112,7 @@ pub fn scan(
|
||||
return WalkState::Continue;
|
||||
};
|
||||
|
||||
let mut state = state.lock().unwrap();
|
||||
let mut state = state.lock();
|
||||
state.push(local);
|
||||
if state.total >= MAX_ENTRIES {
|
||||
return WalkState::Quit;
|
||||
@@ -121,7 +121,7 @@ pub fn scan(
|
||||
})
|
||||
});
|
||||
|
||||
let mut state = state.into_inner().unwrap();
|
||||
let mut state = state.into_inner();
|
||||
state.flush();
|
||||
state.total
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user