diff options
author | 2019-09-04 19:22:47 +0200 | |
---|---|---|
committer | 2019-09-04 19:22:47 +0200 | |
commit | 310be99fa671e98b1e3e84deeb4d1345abedabf6 (patch) | |
tree | 874224914200cb5a5e349e53d1c167b223b2d561 /src/router/device.rs | |
parent | Simply passing of JobBuffer ownership (diff) | |
download | wireguard-rs-310be99fa671e98b1e3e84deeb4d1345abedabf6.tar.xz wireguard-rs-310be99fa671e98b1e3e84deeb4d1345abedabf6.zip |
Expanded outbound test
Diffstat (limited to 'src/router/device.rs')
-rw-r--r-- | src/router/device.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/router/device.rs b/src/router/device.rs index 58ca2f6..2617350 100644 --- a/src/router/device.rs +++ b/src/router/device.rs @@ -18,6 +18,7 @@ use super::peer; use super::peer::{Peer, PeerInner}; use super::SIZE_MESSAGE_PREFIX; +use super::constants::WORKER_QUEUE_SIZE; use super::messages::TYPE_TRANSPORT; use super::types::{Callback, Callbacks, KeyCallback, Opaque, PhantomCallbacks, RouterError}; use super::workers::{worker_parallel, JobParallel}; @@ -113,13 +114,9 @@ impl<O: Opaque, R: Callback<O>, S: Callback<O>, K: KeyCallback<O>, T: Tun, B: Bi let mut queues = Vec::with_capacity(num_workers); let mut threads = Vec::with_capacity(num_workers); for _ in 0..num_workers { - // allocate work queue - let (tx, rx) = sync_channel(128); + let (tx, rx) = sync_channel(WORKER_QUEUE_SIZE); queues.push(spin::Mutex::new(tx)); - - // start worker thread - let device = inner.clone(); - threads.push(thread::spawn(move || worker_parallel(device, rx))); + threads.push(thread::spawn(move || worker_parallel(rx))); } // return exported device handle |