Share single gpu_id_hub among all threads in a process

This commit is contained in:
Kunal Mohan 2020-05-15 00:03:07 +05:30
parent 6c506ba260
commit e5065c7eb2
13 changed files with 54 additions and 8 deletions

View file

@ -18,6 +18,7 @@ use crate::dom::eventtarget::EventTarget;
use crate::dom::extendableevent::ExtendableEvent;
use crate::dom::extendablemessageevent::ExtendableMessageEvent;
use crate::dom::globalscope::GlobalScope;
use crate::dom::identityhub::Identities;
use crate::dom::messageevent::MessageEvent;
use crate::dom::worker::TrustedWorkerAddress;
use crate::dom::workerglobalscope::WorkerGlobalScope;
@ -38,10 +39,12 @@ use js::jsval::UndefinedValue;
use msg::constellation_msg::PipelineId;
use net_traits::request::{CredentialsMode, Destination, ParserMetadata, Referrer, RequestBuilder};
use net_traits::{CustomResponseMediator, IpcSend};
use parking_lot::Mutex;
use script_traits::{ScopeThings, ServiceWorkerMsg, WorkerGlobalScopeInit, WorkerScriptLoadOrigin};
use servo_config::pref;
use servo_rand::random;
use servo_url::ServoUrl;
use std::sync::Arc;
use std::thread;
use std::time::{Duration, Instant};
use style::thread_state::{self, ThreadState};
@ -210,6 +213,7 @@ impl ServiceWorkerGlobalScope {
runtime,
from_devtools_receiver,
None,
Arc::new(Mutex::new(Identities::new())),
),
task_queue: TaskQueue::new(receiver, own_sender.clone()),
own_sender: own_sender,