pass exit by ref (#25120)

This commit is contained in:
HaoranYi 2022-05-11 09:17:21 -05:00 committed by GitHub
parent a8930ee14b
commit 41d34d45e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -24,8 +24,8 @@ pub struct PohTimingReportService {
}
impl PohTimingReportService {
pub fn new(receiver: PohTimingReceiver, exit: Arc<AtomicBool>) -> Self {
let exit_signal = exit;
pub fn new(receiver: PohTimingReceiver, exit: &Arc<AtomicBool>) -> Self {
let exit_signal = exit.clone();
let mut poh_timing_reporter = PohTimingReporter::default();
let t_poh_timing = Builder::new()
.name("poh_timing_report".to_string())
@ -65,7 +65,7 @@ mod test {
let exit = Arc::new(AtomicBool::new(false));
// Create the service
let poh_timing_report_service =
PohTimingReportService::new(poh_timing_point_receiver, exit.clone());
PohTimingReportService::new(poh_timing_point_receiver, &exit);
// Send SlotPohTimingPoint
let _ = poh_timing_point_sender.send(SlotPohTimingInfo::new_slot_start_poh_time_point(

View File

@ -501,7 +501,7 @@ impl Validator {
let (poh_timing_point_sender, poh_timing_point_receiver) = unbounded();
let poh_timing_report_service =
PohTimingReportService::new(poh_timing_point_receiver, exit.clone());
PohTimingReportService::new(poh_timing_point_receiver, &exit);
let (
genesis_config,