From 4223aff84080370bab279a013349bcde1d6ab307 Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Wed, 9 May 2018 14:24:00 -0600 Subject: [PATCH] Remove useless ref counts --- src/accounting_stage.rs | 10 +++++----- src/historian.rs | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/accounting_stage.rs b/src/accounting_stage.rs index 27dc1472b..51fa2bbad 100644 --- a/src/accounting_stage.rs +++ b/src/accounting_stage.rs @@ -11,12 +11,12 @@ use result::Result; use signature::PublicKey; use std::net::{SocketAddr, UdpSocket}; use std::sync::mpsc::{channel, Receiver, Sender}; -use std::sync::{Arc, Mutex}; +use std::sync::Mutex; use transaction::Transaction; pub struct AccountingStage { - pub output: Arc>>, - entry_sender: Arc>>, + pub output: Mutex>, + entry_sender: Mutex>, pub acc: Accountant, historian_input: Mutex>, historian: Mutex, @@ -30,8 +30,8 @@ impl AccountingStage { let historian = Historian::new(event_receiver, start_hash, ms_per_tick); let (entry_sender, output) = channel(); AccountingStage { - output: Arc::new(Mutex::new(output)), - entry_sender: Arc::new(Mutex::new(entry_sender)), + output: Mutex::new(output), + entry_sender: Mutex::new(entry_sender), acc, entry_info_subscribers: Mutex::new(vec![]), historian_input: Mutex::new(historian_input), diff --git a/src/historian.rs b/src/historian.rs index 12aa76053..7796adfca 100644 --- a/src/historian.rs +++ b/src/historian.rs @@ -5,12 +5,12 @@ use entry::Entry; use hash::Hash; use recorder::{ExitReason, Recorder, Signal}; use std::sync::mpsc::{channel, Receiver, Sender, TryRecvError}; -use std::sync::{Arc, Mutex}; +use std::sync::Mutex; use std::thread::{spawn, JoinHandle}; use std::time::Instant; pub struct Historian { - pub output: Arc>>, + pub output: Mutex>, pub thread_hdl: JoinHandle, } @@ -23,9 +23,8 @@ impl Historian { let (entry_sender, output) = channel(); let thread_hdl = Historian::create_recorder(*start_hash, ms_per_tick, event_receiver, entry_sender); - let loutput = Arc::new(Mutex::new(output)); Historian { - output: loutput, + output: Mutex::new(output), thread_hdl, } }