X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/3abd3952c1f4441f0dd6eae9883b2d01ed9cd56b..b2609562b3d4fc548afcc0a3dfe4ff5fd4ae3d36:/rsm.cc diff --git a/rsm.cc b/rsm.cc index 54713cb..a44c24b 100644 --- a/rsm.cc +++ b/rsm.cc @@ -90,7 +90,7 @@ rsm::rsm(const string & _first, const string & _me) : stf(0), primary(_first), insync (false), inviewchange (true), vid_commit(0), partitioned (false), dopartition(false), break1(false), break2(false) { - cfg = new config(_first, _me, this); + cfg = unique_ptr(new config(_first, _me, this)); if (_first == _me) { // Commit the first view here. We can not have acceptor::acceptor @@ -106,14 +106,16 @@ rsm::rsm(const string & _first, const string & _me) : rsmrpc->reg(rsm_protocol::joinreq, &rsm::joinreq, this); // tester must be on different port, otherwise it may partition itself - testsvr = new rpcs((in_port_t)stoi(_me) + 1); + testsvr = unique_ptr(new rpcs((in_port_t)stoi(_me) + 1)); testsvr->reg(rsm_test_protocol::net_repair, &rsm::test_net_repairreq, this); testsvr->reg(rsm_test_protocol::breakpoint, &rsm::breakpointreq, this); +} - { - lock ml(rsm_mutex); - thread(&rsm::recovery, this).detach(); - } +void rsm::start() { + lock ml(rsm_mutex); + rsmrpc->start(); + testsvr->start(); + thread(&rsm::recovery, this).detach(); } void rsm::reg1(int proc, handler *h) {