convert std::sync::mpsc to crossbeam_channel (#22264)

This commit is contained in:
Jeff Biseda
2022-01-11 02:44:46 -08:00
committed by GitHub
parent 3c44d405c7
commit 8b66625c95
81 changed files with 313 additions and 346 deletions

View File

@@ -13,6 +13,7 @@ edition = "2021"
bincode = "1.3.3"
byteorder = "1.4.3"
clap = "2.33"
crossbeam-channel = "0.5"
log = "0.4.14"
serde = "1.0.133"
serde_derive = "1.0.103"

View File

@@ -7,6 +7,7 @@
use {
bincode::{deserialize, serialize, serialized_size},
byteorder::{ByteOrder, LittleEndian},
crossbeam_channel::{unbounded, Sender},
log::*,
serde_derive::{Deserialize, Serialize},
solana_metrics::datapoint_info,
@@ -25,7 +26,7 @@ use {
collections::{HashMap, HashSet},
io::{Read, Write},
net::{IpAddr, Ipv4Addr, SocketAddr, TcpStream},
sync::{mpsc::Sender, Arc, Mutex},
sync::{Arc, Mutex},
thread,
time::Duration,
},
@@ -347,7 +348,7 @@ pub fn run_local_faucet_with_port(
// For integration tests. Listens on random open port and reports port to Sender.
pub fn run_local_faucet(faucet_keypair: Keypair, per_time_cap: Option<u64>) -> SocketAddr {
let (sender, receiver) = std::sync::mpsc::channel();
let (sender, receiver) = unbounded();
run_local_faucet_with_port(faucet_keypair, sender, per_time_cap, 0);
receiver
.recv()