Fixed some misses.

This commit is contained in:
Acrimon 2019-07-12 20:51:22 +02:00
parent 69537f7dd9
commit 20ac81a986
5 changed files with 155 additions and 192 deletions

333
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -10,4 +10,5 @@ common = { package = "veloren-common", path = "../common" }
log = "0.4"
specs = "0.14"
vek = "0.9"
threadpool = "1.7"
uvth = "3"
num_cpus = "1"

View File

@ -22,7 +22,7 @@ use std::{
sync::Arc,
time::{Duration, Instant},
};
use threadpool::ThreadPool;
use uvth::{ThreadPool, ThreadPoolBuilder};
use vek::*;
const SERVER_TIMEOUT: Duration = Duration::from_secs(20);
@ -78,11 +78,11 @@ impl Client {
postbox.send_message(ClientMsg::Ping);
let mut thread_pool = threadpool::Builder::new()
.thread_name("veloren-worker".into())
let mut thread_pool = ThreadPoolBuilder::new()
.name("veloren-worker".into())
.build();
// We reduce the thread count by 1 to keep rendering smooth
thread_pool.set_num_threads((thread_pool.max_count() - 1).max(1));
thread_pool.set_num_threads(num_cpus::get() - 1);
// Set client-only components
let _ = state

View File

@ -11,7 +11,6 @@ specs = { version = "0.14", features = ["serde", "nightly"] }
vek = { version = "0.9", features = ["serde"] }
dot_vox = "4.0"
image = "0.21"
threadpool = "1.7"
mio = "0.6"
mio-extras = "2.0"
serde = "1.0"

View File

@ -153,7 +153,7 @@ impl Terrain {
})
.min_by_key(|todo| todo.active_worker.unwrap_or(todo.started_tick))
{
if client.thread_pool().queued_count() > 0 {
if client.thread_pool().queued_jobs() > 0 {
break;
}