Skip to content

Commit

Permalink
Switched to usage of crate bastion-utils
Browse files Browse the repository at this point in the history
Fix format errors
  • Loading branch information
lurk-skywater committed Jan 5, 2020
1 parent 234bfdd commit a62a93c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"bastion",
"bastion-executor",
"bastion-utils",
"lightproc"
]

Expand Down
1 change: 1 addition & 0 deletions bastion-executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ maintenance = { status = "actively-developed" }
unstable = ["numanji", "allocator-suite", "jemallocator"]

[dependencies]
bastion-utils = { version = "0.3.2", path = "../bastion-utils" }
crossbeam-utils = "0.7"
crossbeam-channel = "0.4"
crossbeam-epoch = "0.8"
Expand Down
17 changes: 8 additions & 9 deletions bastion-executor/src/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,24 @@
//! to even out the load.
use std::collections::VecDeque;

use std::future::Future;
use std::io::ErrorKind;
use std::iter::Iterator;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Mutex;
use std::time::Duration;
use std::{env, thread};

use crossbeam_channel::{bounded, Receiver, Sender};
use lazy_static::lazy_static;

use crate::{load_balancer, placement, utils};
use bastion_utils::math;
use lazy_static::lazy_static;
use lightproc::lightproc::LightProc;
use lightproc::proc_stack::ProcStack;
use lightproc::recoverable_handle::RecoverableHandle;
use std::future::Future;
use std::io::ErrorKind;
use std::iter::Iterator;

use crate::placement::CoreId;

use std::sync::Mutex;
use crate::{load_balancer, placement};

/// If low watermark isn't configured this is the default scaler value.
/// This value is used for the heuristics of the scaler
Expand Down Expand Up @@ -264,7 +263,7 @@ fn create_blocking_thread() {
//
// Generate a simple random number of milliseconds
let rand_sleep_ms = 1000_u64
.checked_add(u64::from(utils::random(10_000)))
.checked_add(u64::from(math::random(10_000)))
.expect("shouldn't overflow");

let _ = thread::Builder::new()
Expand Down
2 changes: 0 additions & 2 deletions bastion-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ pub mod run_queue;
pub mod sleepers;
pub mod worker;

mod utils;

///
/// Prelude of Bastion Executor
pub mod prelude {
Expand Down

0 comments on commit a62a93c

Please sign in to comment.