diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-12-14 16:48:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-14 16:48:42 -0800 |
commit | 4eb653817f87e5fb47de34356f558eb76ecbca9f (patch) | |
tree | f7ad2b7f47c0df54aa6d190912f95dff621cc9ac /components/net/image_cache_thread.rs | |
parent | 6ee175bf705108ab25e80521d7be84b5e58ef698 (diff) | |
parent | 9be4fd56ce5467ce6d0e48c6efda9eb26f40eb7a (diff) | |
download | servo-4eb653817f87e5fb47de34356f558eb76ecbca9f.tar.gz servo-4eb653817f87e5fb47de34356f558eb76ecbca9f.zip |
Auto merge of #14592 - asajeffrey:util-goodbye, r=mbrubeck
Remove the util crate
<!-- Please describe your changes on the following line: -->
This PR removes the `util` crate.
* Replaced the `spawn_named` and `clamp` functions by appropriate uses of `std::thread::Builder::spawn`, `std::cmp::min` and `std::cmp::max`.
* Moved `opts`, `prefs` and `resource_files` into a new `config` crate.
* Moved `remutex` and `geometry` into their own crates.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because they are refactorings
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14592)
<!-- Reviewable:end -->
Diffstat (limited to 'components/net/image_cache_thread.rs')
-rw-r--r-- | components/net/image_cache_thread.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/net/image_cache_thread.rs b/components/net/image_cache_thread.rs index 5976ec50885..b466374d381 100644 --- a/components/net/image_cache_thread.rs +++ b/components/net/image_cache_thread.rs @@ -11,6 +11,7 @@ use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheCommand, ImageCac use net_traits::image_cache_thread::{ImageCacheResult, ImageOrMetadataAvailable, ImageResponse, UsePlaceholder}; use net_traits::image_cache_thread::ImageResponder; use net_traits::request::{Destination, RequestInit, Type as RequestType}; +use servo_config::resource_files::resources_dir_path; use servo_url::ServoUrl; use std::borrow::ToOwned; use std::collections::HashMap; @@ -20,9 +21,8 @@ use std::io::{self, Read}; use std::mem; use std::sync::Arc; use std::sync::mpsc::{Receiver, Sender, channel}; +use std::thread; use threadpool::ThreadPool; -use util::resource_files::resources_dir_path; -use util::thread::spawn_named; use webrender_traits; /// @@ -648,9 +648,9 @@ pub fn new_image_cache_thread(core_resource_thread: CoreResourceThread, webrender_api: webrender_traits::RenderApi) -> ImageCacheThread { let (ipc_command_sender, ipc_command_receiver) = ipc::channel().unwrap(); - spawn_named("ImageCacheThread".to_owned(), move || { + thread::Builder::new().name("ImageCacheThread".to_owned()).spawn(move || { ImageCache::run(core_resource_thread, webrender_api, ipc_command_receiver) - }); + }).expect("Thread spawning failed"); ImageCacheThread::new(ipc_command_sender) } |