mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Replace mpsc with crossbeam/servo channel, update ipc-channel
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
This commit is contained in:
parent
b977b4994c
commit
2a996fbc8f
89 changed files with 341 additions and 377 deletions
|
@ -94,6 +94,7 @@ use script_traits::{TimerSchedulerMsg, UntrustedNodeAddress, WindowSizeData, Win
|
|||
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
||||
use selectors::attr::CaseSensitivity;
|
||||
use servo_arc;
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_config::opts;
|
||||
use servo_geometry::{f32_rect_to_au_rect, MaxRect};
|
||||
use servo_url::{Host, MutableOrigin, ImmutableOrigin, ServoUrl};
|
||||
|
@ -109,8 +110,6 @@ use std::mem;
|
|||
use std::rc::Rc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::mpsc::{Sender, channel};
|
||||
use std::sync::mpsc::TryRecvError::{Disconnected, Empty};
|
||||
use style::error_reporting::ParseErrorReporter;
|
||||
use style::media_queries;
|
||||
use style::parser::ParserContext as CssParserContext;
|
||||
|
@ -1376,15 +1375,16 @@ impl Window {
|
|||
|
||||
debug!("script: layout forked");
|
||||
|
||||
let complete = match join_port.try_recv() {
|
||||
Err(Empty) => {
|
||||
let complete = select! {
|
||||
recv(join_port.select(), msg) => if let Some(reflow_complete) = msg {
|
||||
reflow_complete
|
||||
} else {
|
||||
panic!("Layout thread failed while script was waiting for a result.");
|
||||
},
|
||||
default => {
|
||||
info!("script: waiting on layout");
|
||||
join_port.recv().unwrap()
|
||||
}
|
||||
Ok(reflow_complete) => reflow_complete,
|
||||
Err(Disconnected) => {
|
||||
panic!("Layout thread failed while script was waiting for a result.");
|
||||
}
|
||||
};
|
||||
|
||||
debug!("script: layout joined");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue