B:BD[
2.45425] → [
2.45425:46593]
workers.push(std::thread::spawn(move || loop {
let (w, stop) = {
let mut work = work.lock().unwrap();
(work.t.pop_front(), work.stop)
};
if let Some((item, vertex, rec, new_papa)) = w {
// This parent has changed.
info!("record existing file {:?} on thread {:?}", item, t);
rec.lock()
.unwrap()
.record_existing_file(
txn.clone(),
diff_algorithm,
channel.clone(),
working_copy.clone(),
&changes,
&item,
new_papa,
vertex,
)
.unwrap();
} else if stop {
info!("stop {:?}", t);
break;
} else {
info!("yield {:?}", t);
std::thread::park_timeout(std::time::Duration::from_secs(1));
workers.push(std::thread::spawn(move || {
loop {
let (w, stop) = {
let mut work = work.lock().unwrap();
(work.t.pop_front(), work.stop)
};
if let Some((item, vertex, rec, new_papa)) = w {
// This parent has changed.
info!("record existing file {:?} on thread {:?}", item, t);
rec.lock()
.unwrap()
.record_existing_file(
txn.clone(),
diff_algorithm,
channel.clone(),
working_copy.clone(),
&changes,
&item,
new_papa,
vertex,
)?;
} else if stop {
info!("stop {:?}", t);
break;
} else {
info!("yield {:?}", t);
std::thread::park_timeout(std::time::Duration::from_secs(1));
}