script: Don't hold the stderr lock while doing sync operations with the constellation.

Otherwise if you enable debug logging, you deadlock.
This commit is contained in:
Emilio Cobos Álvarez 2016-07-24 14:04:17 -07:00
parent e6958d3947
commit 702445a3ec
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -450,13 +450,15 @@ impl WindowMethods for Window {
// Right now, just print to the console
// Ensure that stderr doesn't trample through the alert() we use to
// communicate test results (see executorservo.py in wptrunner).
let stderr = stderr();
let mut stderr = stderr.lock();
let stdout = stdout();
let mut stdout = stdout.lock();
writeln!(&mut stdout, "ALERT: {}", s).unwrap();
stdout.flush().unwrap();
stderr.flush().unwrap();
{
let stderr = stderr();
let mut stderr = stderr.lock();
let stdout = stdout();
let mut stdout = stdout.lock();
writeln!(&mut stdout, "ALERT: {}", s).unwrap();
stdout.flush().unwrap();
stderr.flush().unwrap();
}
let (sender, receiver) = ipc::channel().unwrap();
self.constellation_chan().send(ConstellationMsg::Alert(self.pipeline(), s.to_string(), sender)).unwrap();