mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Replaced mutex in constellation logging by a reentrant mutex.
This commit is contained in:
parent
4077ae7d04
commit
e3030d053a
6 changed files with 319 additions and 5 deletions
|
@ -54,8 +54,8 @@ use std::iter::once;
|
|||
use std::marker::PhantomData;
|
||||
use std::mem::replace;
|
||||
use std::process;
|
||||
use std::sync::Arc;
|
||||
use std::sync::mpsc::{Sender, channel, Receiver};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
use std::time::Instant;
|
||||
use style_traits::PagePx;
|
||||
|
@ -65,6 +65,7 @@ use timer_scheduler::TimerScheduler;
|
|||
use url::Url;
|
||||
use util::opts;
|
||||
use util::prefs::PREFS;
|
||||
use util::remutex::ReentrantMutex;
|
||||
use util::thread::spawn_named;
|
||||
use webrender_traits;
|
||||
|
||||
|
@ -314,14 +315,14 @@ enum ExitPipelineMode {
|
|||
#[derive(Clone)]
|
||||
pub struct FromScriptLogger {
|
||||
/// A channel to the constellation
|
||||
pub constellation_chan: Arc<Mutex<IpcSender<FromScriptMsg>>>,
|
||||
pub constellation_chan: Arc<ReentrantMutex<IpcSender<FromScriptMsg>>>,
|
||||
}
|
||||
|
||||
impl FromScriptLogger {
|
||||
/// Create a new constellation logger.
|
||||
pub fn new(constellation_chan: IpcSender<FromScriptMsg>) -> FromScriptLogger {
|
||||
FromScriptLogger {
|
||||
constellation_chan: Arc::new(Mutex::new(constellation_chan))
|
||||
constellation_chan: Arc::new(ReentrantMutex::new(constellation_chan))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -353,14 +354,14 @@ impl Log for FromScriptLogger {
|
|||
#[derive(Clone)]
|
||||
pub struct FromCompositorLogger {
|
||||
/// A channel to the constellation
|
||||
pub constellation_chan: Arc<Mutex<Sender<FromCompositorMsg>>>,
|
||||
pub constellation_chan: Arc<ReentrantMutex<Sender<FromCompositorMsg>>>,
|
||||
}
|
||||
|
||||
impl FromCompositorLogger {
|
||||
/// Create a new constellation logger.
|
||||
pub fn new(constellation_chan: Sender<FromCompositorMsg>) -> FromCompositorLogger {
|
||||
FromCompositorLogger {
|
||||
constellation_chan: Arc::new(Mutex::new(constellation_chan))
|
||||
constellation_chan: Arc::new(ReentrantMutex::new(constellation_chan))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue