mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
add servo_channel crate
This commit is contained in:
parent
704f7a06b1
commit
b977b4994c
12 changed files with 252 additions and 11 deletions
|
@ -34,6 +34,8 @@ extern crate profile_traits;
|
|||
extern crate script_traits;
|
||||
#[macro_use]
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
extern crate servo_channel;
|
||||
extern crate servo_config;
|
||||
extern crate servo_rand;
|
||||
extern crate servo_remutex;
|
||||
|
|
|
@ -6,8 +6,7 @@ use ipc_channel::ipc::{self, IpcSender};
|
|||
use script_traits::{TimerEvent, TimerEventRequest, TimerSchedulerMsg};
|
||||
use std::cmp::{self, Ord};
|
||||
use std::collections::BinaryHeap;
|
||||
use std::sync::mpsc;
|
||||
use std::sync::mpsc::TryRecvError::{Disconnected, Empty};
|
||||
use servo_channel::base_channel;
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
@ -40,7 +39,7 @@ impl PartialEq for ScheduledEvent {
|
|||
impl TimerScheduler {
|
||||
pub fn start() -> IpcSender<TimerSchedulerMsg> {
|
||||
let (req_ipc_sender, req_ipc_receiver) = ipc::channel().expect("Channel creation failed.");
|
||||
let (req_sender, req_receiver) = mpsc::sync_channel(1);
|
||||
let (req_sender, req_receiver) = base_channel::bounded(1);
|
||||
|
||||
// We could do this much more directly with recv_timeout
|
||||
// (https://github.com/rust-lang/rfcs/issues/962).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue