mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
net: clean shutdown of fetch thread (#38421)
The fetch thread is currently not shut down, meaning it is one of the threads counted in the "threads are still running after shutdown (bad)" counter shown when Servo has shut-down. This PR introduces a mechanism to start, and shut-down, one fetch thread per process that requires one. Testing: WPT tests and unit tests(for font context). Also manually tested loading and closing "about:blank": this change indeed brings down the count of threads still running after shutdown by one. Fixes: https://github.com/servo/servo/issues/34887 --------- Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
parent
ad805e3110
commit
b23cf9c6cd
5 changed files with 71 additions and 11 deletions
|
@ -35,8 +35,8 @@ use layout_api::{LayoutFactory, ScriptThreadFactory};
|
|||
use log::{debug, error, warn};
|
||||
use media::WindowGLContext;
|
||||
use net::image_cache::ImageCacheImpl;
|
||||
use net_traits::ResourceThreads;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use net_traits::{CoreResourceThread, ResourceThreads};
|
||||
use profile::system_reporter;
|
||||
use profile_traits::mem::{ProfilerMsg, Reporter};
|
||||
use profile_traits::{mem as profile_mem, time};
|
||||
|
@ -575,6 +575,10 @@ impl UnprivilegedPipelineContent {
|
|||
&self.script_to_constellation_chan
|
||||
}
|
||||
|
||||
pub fn core_resource_thread(&self) -> &CoreResourceThread {
|
||||
&self.resource_threads.core_thread
|
||||
}
|
||||
|
||||
pub fn opts(&self) -> Opts {
|
||||
self.opts.clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue