Fixed a race condition!
[invirt/third/libt4.git] / rsm.h
diff --git a/rsm.h b/rsm.h
index 1e1726d..8fdf2d5 100644 (file)
--- a/rsm.h
+++ b/rsm.h
@@ -21,7 +21,7 @@ class rsm : public config_view_change {
         void reg1(int proc, handler *);
     protected:
         map<int, handler *> procs;
-        config *cfg;
+        unique_ptr<config> cfg;
         rsm_state_transfer *stf = nullptr;
         rpcs *rsmrpc;
         // On slave: expected viewstamp of next invoke request
@@ -36,7 +36,7 @@ class rsm : public config_view_change {
         vector<string> backups;   // A list of unsynchronized backups
 
         // For testing purposes
-        rpcs *testsvr;
+        unique_ptr<rpcs> testsvr;
         bool partitioned;
         bool dopartition;
         bool break1;
@@ -76,6 +76,8 @@ class rsm : public config_view_change {
         void commit_change(unsigned vid);
 
         template<class F, class C=void> void reg(int proc, F f, C *c=nullptr);
+
+        void start();
 };
 
 template<class F, class C> void rsm::reg(int proc, F f, C *c) {