Exit signal cleanup: pass in references, make the receiver clone as needed

This commit is contained in:
Michael Vines
2019-03-04 16:33:14 -08:00
parent 794e961328
commit 906df5e20e
11 changed files with 36 additions and 48 deletions

View File

@@ -47,7 +47,7 @@ impl PohService {
pub fn new(
poh_recorder: Arc<Mutex<PohRecorder>>,
config: &PohServiceConfig,
poh_exit: Arc<AtomicBool>,
poh_exit: &Arc<AtomicBool>,
) -> Self {
// PohService is a headless producer, so when it exits it should notify the banking stage.
// Since channel are not used to talk between these threads an AtomicBool is used as a
@@ -66,7 +66,7 @@ impl PohService {
Self {
tick_producer,
poh_exit,
poh_exit: poh_exit.clone(),
}
}
@@ -157,7 +157,7 @@ mod tests {
let poh_service = PohService::new(
poh_recorder.clone(),
&PohServiceConfig::Tick(HASHES_PER_TICK as usize),
Arc::new(AtomicBool::new(false)),
&Arc::new(AtomicBool::new(false)),
);
poh_recorder.lock().unwrap().set_working_bank(working_bank);