mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
parent
6781db1588
commit
fd76f56ba4
4 changed files with 4 additions and 16 deletions
|
@ -340,7 +340,6 @@ impl SharedModuleCache {
|
|||
where
|
||||
NormalizedPathBuf: Borrow<Q>,
|
||||
{
|
||||
println!("343");
|
||||
let mut cache = loop {
|
||||
if let Some(cache) = self.0.try_borrow_mut() {
|
||||
break cache;
|
||||
|
|
|
@ -160,7 +160,6 @@ impl SharedPromises {
|
|||
}
|
||||
|
||||
pub fn wait_until_finished(&self, path: &NormalizedPathBuf) {
|
||||
println!("163");
|
||||
if self.promises.borrow().get(path).is_none() {
|
||||
panic!("not registered: {path}");
|
||||
}
|
||||
|
@ -180,11 +179,9 @@ impl SharedPromises {
|
|||
return Ok(());
|
||||
}
|
||||
if SINGLE_THREAD {
|
||||
println!("182: {path}");
|
||||
assert!(self.is_joined(path));
|
||||
return Ok(());
|
||||
}
|
||||
println!("!?: {path}");
|
||||
// Suppose A depends on B and C, and B depends on C.
|
||||
// In this case, B must join C before A joins C. Otherwise, a deadlock will occur.
|
||||
let children = self.graph.children(path);
|
||||
|
@ -226,14 +223,14 @@ impl SharedPromises {
|
|||
paths.push(path.clone());
|
||||
}
|
||||
for path in paths {
|
||||
self.join(&path).unwrap();
|
||||
let _result = self.join(&path);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn join_all(&self) {
|
||||
let paths = self.promises.borrow().keys().cloned().collect::<Vec<_>>();
|
||||
for path in paths {
|
||||
self.join(&path).unwrap();
|
||||
let _result = self.join(&path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue