From 91cf14e64144e9ecf2b82bfd0fc44bf8e1261b15 Mon Sep 17 00:00:00 2001 From: Carl Date: Wed, 12 Sep 2018 15:05:22 -0700 Subject: [PATCH] Rewrote service trait join() method to allow thread join handles to return values other than () --- src/broadcast_stage.rs | 3 ++- src/fullnode.rs | 2 +- src/record_stage.rs | 3 ++- src/request_stage.rs | 3 ++- src/rpc.rs | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/broadcast_stage.rs b/src/broadcast_stage.rs index 62b416f689..9310e27988 100644 --- a/src/broadcast_stage.rs +++ b/src/broadcast_stage.rs @@ -217,6 +217,7 @@ impl Service for BroadcastStage { type JoinReturnType = (); fn join(self) -> thread::Result<()> { - self.thread_hdl.join() + self.thread_hdl.join()?; + Ok(()) } } diff --git a/src/fullnode.rs b/src/fullnode.rs index e297baac20..9d9ee31389 100644 --- a/src/fullnode.rs +++ b/src/fullnode.rs @@ -205,7 +205,7 @@ impl Fullnode { /// `--------` | | `------------` /// `-------------------------------` /// ``` - pub fn new_with_bank( +pub fn new_with_bank( keypair: Keypair, bank: Bank, entry_height: u64, diff --git a/src/record_stage.rs b/src/record_stage.rs index 3edbb7a660..e7ccf58adc 100644 --- a/src/record_stage.rs +++ b/src/record_stage.rs @@ -146,7 +146,8 @@ impl Service for RecordStage { type JoinReturnType = (); fn join(self) -> thread::Result<()> { - self.thread_hdl.join() + self.thread_hdl.join()?; + Ok(()) } } diff --git a/src/request_stage.rs b/src/request_stage.rs index 90e962a370..b40c3ebfd1 100644 --- a/src/request_stage.rs +++ b/src/request_stage.rs @@ -117,6 +117,7 @@ impl Service for RequestStage { type JoinReturnType = (); fn join(self) -> thread::Result<()> { - self.thread_hdl.join() + self.thread_hdl.join()?; + Ok(()) } } diff --git a/src/rpc.rs b/src/rpc.rs index 375f7790c8..ba07b964d9 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -71,7 +71,8 @@ impl Service for JsonRpcService { type JoinReturnType = (); fn join(self) -> thread::Result<()> { - self.thread_hdl.join() + self.thread_hdl.join()?; + Ok(()) } }