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

@@ -10,6 +10,7 @@ license = "Apache-2.0"
edition = "2021"
[dependencies]
crossbeam-channel = "0.5"
log = "0.4.14"
solana-metrics = { path = "../metrics", version = "=1.10.0" }
solana-runtime = { path = "../runtime", version = "=1.10.0" }

View File

@@ -1,5 +1,6 @@
use {
crate::tpu_info::TpuInfo,
crossbeam_channel::{Receiver, RecvTimeoutError},
log::*,
solana_metrics::{datapoint_warn, inc_new_counter_info},
solana_runtime::{bank::Bank, bank_forks::BankForks},
@@ -7,10 +8,7 @@ use {
std::{
collections::HashMap,
net::{SocketAddr, UdpSocket},
sync::{
mpsc::{Receiver, RecvTimeoutError},
Arc, RwLock,
},
sync::{Arc, RwLock},
thread::{self, Builder, JoinHandle},
time::{Duration, Instant},
},
@@ -327,11 +325,11 @@ mod test {
use {
super::*,
crate::tpu_info::NullTpuInfo,
crossbeam_channel::unbounded,
solana_sdk::{
account::AccountSharedData, genesis_config::create_genesis_config, nonce,
pubkey::Pubkey, signature::Signer, system_program, system_transaction,
},
std::sync::mpsc::channel,
};
#[test]
@@ -339,7 +337,7 @@ mod test {
let tpu_address = "127.0.0.1:0".parse().unwrap();
let bank = Bank::default_for_tests();
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank)));
let (sender, receiver) = channel();
let (sender, receiver) = unbounded();
let send_tranaction_service = SendTransactionService::new::<NullTpuInfo>(
tpu_address,