Lots of clean-ups and simplifications
[invirt/third/libt4.git] / rsm.cc
diff --git a/rsm.cc b/rsm.cc
index 478e0e0..b93c701 100644 (file)
--- a/rsm.cc
+++ b/rsm.cc
@@ -95,8 +95,6 @@ rsm::rsm(std::string _first, std::string _me) :
     stf(0), primary(_first), insync (false), inviewchange (true), vid_commit(0),
     partitioned (false), dopartition(false), break1(false), break2(false)
 {
-    std::thread th;
-
     last_myvs.vid = 0;
     last_myvs.seqno = 0;
     myvs = last_myvs;
@@ -124,7 +122,7 @@ rsm::rsm(std::string _first, std::string _me) :
 
     {
         lock ml(rsm_mutex);
-        th = std::thread(&rsm::recovery, this);
+        std::thread(&rsm::recovery, this).detach();
     }
 }
 
@@ -232,7 +230,7 @@ bool rsm::statetransfer(std::string m)
 {
     rsm_protocol::transferres r;
     handle h(m);
-    int ret;
+    int ret = 0;
     tprintf("rsm::statetransfer: contact %s w. my last_myvs(%d,%d)\n",
             m.c_str(), last_myvs.vid, last_myvs.seqno);
     rpcc *cl;
@@ -278,7 +276,7 @@ bool rsm::statetransferdone(std::string m) {
 
 bool rsm::join(std::string m) {
     handle h(m);
-    int ret;
+    int ret = 0;
     rsm_protocol::joinres r;
 
     tprintf("rsm::join: %s mylast (%d,%d)\n", m.c_str(), last_myvs.vid,