mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Remove most usage of ReentrantMutex in font code (#33746)
* Remove unnecessary ReentrantMutex usage for senders. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove double lock for freetype face. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
a591778a25
commit
6b3a316e1b
3 changed files with 8 additions and 9 deletions
|
@ -14,7 +14,7 @@ use atomic_refcell::AtomicRefCell;
|
|||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use log::debug;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use parking_lot::{ReentrantMutex, RwLock};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::pref;
|
||||
use servo_url::ServoUrl;
|
||||
|
@ -121,7 +121,7 @@ pub struct SystemFontServiceProxySender(pub IpcSender<SystemFontServiceMessage>)
|
|||
impl SystemFontServiceProxySender {
|
||||
pub fn to_proxy(&self) -> SystemFontServiceProxy {
|
||||
SystemFontServiceProxy {
|
||||
sender: ReentrantMutex::new(self.0.clone()),
|
||||
sender: Mutex::new(self.0.clone()),
|
||||
templates: Default::default(),
|
||||
data_cache: Default::default(),
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ struct FontTemplateCacheKey {
|
|||
/// `FontContext` instances.
|
||||
#[derive(Debug)]
|
||||
pub struct SystemFontServiceProxy {
|
||||
sender: ReentrantMutex<IpcSender<SystemFontServiceMessage>>,
|
||||
sender: Mutex<IpcSender<SystemFontServiceMessage>>,
|
||||
templates: RwLock<HashMap<FontTemplateCacheKey, Vec<FontTemplateRef>>>,
|
||||
data_cache: RwLock<HashMap<FontIdentifier, Arc<FontData>>>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue