mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Further changes required by Servo
This commit is contained in:
parent
82af75bb94
commit
d868cddb09
1 changed files with 2 additions and 3 deletions
|
@ -17,7 +17,6 @@ use rayon;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::Mutex;
|
|
||||||
|
|
||||||
/// Global style data
|
/// Global style data
|
||||||
pub struct GlobalStyleData {
|
pub struct GlobalStyleData {
|
||||||
|
@ -117,7 +116,7 @@ impl StyleThreadPool {
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
/// Global thread pool
|
/// Global thread pool
|
||||||
pub static ref STYLE_THREAD_POOL: Mutex<StyleThreadPool> = {
|
pub static ref STYLE_THREAD_POOL: std::sync::Mutex<StyleThreadPool> = {
|
||||||
let stylo_threads = env::var("STYLO_THREADS")
|
let stylo_threads = env::var("STYLO_THREADS")
|
||||||
.map(|s| s.parse::<usize>().expect("invalid STYLO_THREADS value"));
|
.map(|s| s.parse::<usize>().expect("invalid STYLO_THREADS value"));
|
||||||
let mut num_threads = match stylo_threads {
|
let mut num_threads = match stylo_threads {
|
||||||
|
@ -171,7 +170,7 @@ lazy_static! {
|
||||||
workers.ok()
|
workers.ok()
|
||||||
};
|
};
|
||||||
|
|
||||||
Mutex::new(StyleThreadPool {
|
std::sync::Mutex::new(StyleThreadPool {
|
||||||
num_threads: if num_threads > 0 {
|
num_threads: if num_threads > 0 {
|
||||||
Some(num_threads)
|
Some(num_threads)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue