mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Replace remutex
with parking_lot
's ReentrantMutex
(#31817)
Many things in Servo depend on `parking_lot`, so we can replace our homegrown remutex with `parking_lot`'s version. Fixes #12641.
This commit is contained in:
parent
8882507ad0
commit
34dd38b4cb
7 changed files with 5 additions and 388 deletions
|
@ -11,8 +11,8 @@ use compositing_traits::ConstellationMsg as FromCompositorMsg;
|
|||
use crossbeam_channel::Sender;
|
||||
use log::{Level, LevelFilter, Log, Metadata, Record};
|
||||
use msg::constellation_msg::TopLevelBrowsingContextId;
|
||||
use parking_lot::ReentrantMutex;
|
||||
use script_traits::{LogEntry, ScriptMsg as FromScriptMsg, ScriptToConstellationChan};
|
||||
use servo_remutex::ReentrantMutex;
|
||||
|
||||
/// The constellation uses logging to perform crash reporting.
|
||||
/// The constellation receives all `warn!`, `error!` and `panic!` messages,
|
||||
|
@ -55,10 +55,7 @@ impl Log for FromScriptLogger {
|
|||
if let Some(entry) = log_entry(record) {
|
||||
let thread_name = thread::current().name().map(ToOwned::to_owned);
|
||||
let msg = FromScriptMsg::LogEntry(thread_name, entry);
|
||||
let chan = self
|
||||
.script_to_constellation_chan
|
||||
.lock()
|
||||
.unwrap_or_else(|err| err.into_inner());
|
||||
let chan = self.script_to_constellation_chan.lock();
|
||||
let _ = chan.send(msg);
|
||||
}
|
||||
}
|
||||
|
@ -97,10 +94,7 @@ impl Log for FromCompositorLogger {
|
|||
let top_level_id = TopLevelBrowsingContextId::installed();
|
||||
let thread_name = thread::current().name().map(ToOwned::to_owned);
|
||||
let msg = FromCompositorMsg::LogEntry(top_level_id, thread_name, entry);
|
||||
let chan = self
|
||||
.constellation_chan
|
||||
.lock()
|
||||
.unwrap_or_else(|err| err.into_inner());
|
||||
let chan = self.constellation_chan.lock();
|
||||
let _ = chan.send(msg);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue