webgpu: Remove mutex around Identities (#32682)

This commit is contained in:
派卡 (pi-cla) 2024-07-03 18:39:45 +00:00 committed by GitHub
parent 959ffad99a
commit 650af7db92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 69 additions and 100 deletions

View file

@ -21,7 +21,6 @@ use net_traits::request::{
CredentialsMode, Destination, ParserMetadata, Referrer, RequestBuilder, RequestMode,
};
use net_traits::IpcSend;
use parking_lot::Mutex;
use script_traits::{WorkerGlobalScopeInit, WorkerScriptLoadOrigin};
use servo_rand::random;
use servo_url::{ImmutableOrigin, ServoUrl};
@ -254,7 +253,7 @@ impl DedicatedWorkerGlobalScope {
closing: Arc<AtomicBool>,
image_cache: Arc<dyn ImageCache>,
browsing_context: Option<BrowsingContextId>,
gpu_id_hub: Arc<Mutex<Identities>>,
gpu_id_hub: Arc<Identities>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
) -> DedicatedWorkerGlobalScope {
DedicatedWorkerGlobalScope {
@ -292,7 +291,7 @@ impl DedicatedWorkerGlobalScope {
closing: Arc<AtomicBool>,
image_cache: Arc<dyn ImageCache>,
browsing_context: Option<BrowsingContextId>,
gpu_id_hub: Arc<Mutex<Identities>>,
gpu_id_hub: Arc<Identities>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
) -> DomRoot<DedicatedWorkerGlobalScope> {
let cx = runtime.cx();
@ -331,7 +330,7 @@ impl DedicatedWorkerGlobalScope {
closing: Arc<AtomicBool>,
image_cache: Arc<dyn ImageCache>,
browsing_context: Option<BrowsingContextId>,
gpu_id_hub: Arc<Mutex<Identities>>,
gpu_id_hub: Arc<Identities>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
context_sender: Sender<ContextForRequestInterrupt>,
) -> JoinHandle<()> {