mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
auto merge of #4911 : Ms2ger/servo/join_layout, r=jdm
This commit is contained in:
commit
c5a4e78302
1 changed files with 11 additions and 17 deletions
|
@ -327,25 +327,19 @@ impl Page {
|
|||
/// layout task has finished any pending request messages.
|
||||
fn join_layout(&self) {
|
||||
let mut layout_join_port = self.layout_join_port.borrow_mut();
|
||||
if layout_join_port.is_some() {
|
||||
let join_port = replace(&mut *layout_join_port, None);
|
||||
match join_port {
|
||||
Some(ref join_port) => {
|
||||
match join_port.try_recv() {
|
||||
Err(Empty) => {
|
||||
info!("script: waiting on layout");
|
||||
join_port.recv().unwrap();
|
||||
}
|
||||
Ok(_) => {}
|
||||
Err(Disconnected) => {
|
||||
panic!("Layout task failed while script was waiting for a result.");
|
||||
}
|
||||
}
|
||||
|
||||
debug!("script: layout joined")
|
||||
if let Some(join_port) = replace(&mut *layout_join_port, None) {
|
||||
match join_port.try_recv() {
|
||||
Err(Empty) => {
|
||||
info!("script: waiting on layout");
|
||||
join_port.recv().unwrap();
|
||||
}
|
||||
Ok(_) => {}
|
||||
Err(Disconnected) => {
|
||||
panic!("Layout task failed while script was waiting for a result.");
|
||||
}
|
||||
None => panic!("reader forked but no join port?"),
|
||||
}
|
||||
|
||||
debug!("script: layout joined")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue