From 41d34d45e013f7d7924fd57359aa235278a5a1e3 Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Wed, 11 May 2022 09:17:21 -0500 Subject: [PATCH] pass exit by ref (#25120) --- core/src/poh_timing_report_service.rs | 6 +++--- core/src/validator.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/poh_timing_report_service.rs b/core/src/poh_timing_report_service.rs index f2e43da073..175b3cdc83 100644 --- a/core/src/poh_timing_report_service.rs +++ b/core/src/poh_timing_report_service.rs @@ -24,8 +24,8 @@ pub struct PohTimingReportService { } impl PohTimingReportService { - pub fn new(receiver: PohTimingReceiver, exit: Arc) -> Self { - let exit_signal = exit; + pub fn new(receiver: PohTimingReceiver, exit: &Arc) -> 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( diff --git a/core/src/validator.rs b/core/src/validator.rs index bd90dfab23..5eca0766f6 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -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,