diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-12-09 13:38:08 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-12-09 13:38:08 +0100 |
commit | 3b376cd6fba75787b08bb9bed8413a0d40998c26 (patch) | |
tree | a951aeb5ab0d7b48396593832c48388d6df27ece /src/wireguard/router/pool.rs | |
parent | Merge branch 'runq' of ssh://git.zx2c4.com/wireguard-rs into runq (diff) | |
download | wireguard-rs-3b376cd6fba75787b08bb9bed8413a0d40998c26.tar.xz wireguard-rs-3b376cd6fba75787b08bb9bed8413a0d40998c26.zip |
Formatting
Diffstat (limited to 'src/wireguard/router/pool.rs')
-rw-r--r-- | src/wireguard/router/pool.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wireguard/router/pool.rs b/src/wireguard/router/pool.rs index 98b1144..07a9bfa 100644 --- a/src/wireguard/router/pool.rs +++ b/src/wireguard/router/pool.rs @@ -1,8 +1,8 @@ use arraydeque::ArrayDeque; use spin::{Mutex, MutexGuard}; +use std::mem; use std::sync::mpsc::Receiver; use std::sync::Arc; -use std::mem; use super::runq::{RunQueue, ToKey}; @@ -76,7 +76,7 @@ impl<P, B> InorderQueue<P, B> { return; } }; - + // apply function if job complete let ret = if let Some(mut guard) = elem.complete() { mem::drop(queue); @@ -100,9 +100,9 @@ impl<P, B> InorderQueue<P, B> { /// Applicable for both decryption and encryption workers. #[inline(always)] pub fn worker_parallel< - P : ToKey, // represents a peer (atomic reference counted pointer) - B, // inner body type (message buffer, key material, ...) - D, // device + P: ToKey, // represents a peer (atomic reference counted pointer) + B, // inner body type (message buffer, key material, ...) + D, // device W: Fn(&P, &mut B), Q: Fn(&D) -> &RunQueue<P>, >( @@ -131,8 +131,8 @@ pub fn worker_parallel< work(&peer, &mut job.body); peer }; - + // process inorder jobs for peer queue(&device).insert(peer); } -}
\ No newline at end of file +} |