summaryrefslogtreecommitdiffstats
path: root/src/mon/Paxos.cc
diff options
context:
space:
mode:
authorPatrick Donnelly <pdonnell@redhat.com>2019-08-14 20:23:42 +0200
committerKefu Chai <tchaikov@gmail.com>2019-09-16 13:52:36 +0200
commit489b30844e86dab102f768796251783b6e4a5f8f (patch)
tree4166389c1b8ad8a8204bf668f8356b6df7e9fb25 /src/mon/Paxos.cc
parentosd: add missing header (diff)
downloadceph-489b30844e86dab102f768796251783b6e4a5f8f.tar.xz
ceph-489b30844e86dab102f768796251783b6e4a5f8f.zip
include: convert FunctionContext usage to generic LambdaContext
The main motivation for this change is to avoid copies due to the use of boost::function/std::function where captures of std::unique_ptr (in subsequent commits) would fail to compile. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Diffstat (limited to 'src/mon/Paxos.cc')
-rw-r--r--src/mon/Paxos.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 2859ff2ce47..a6bf59b853f 100644
--- a/src/mon/Paxos.cc
+++ b/src/mon/Paxos.cc
@@ -203,11 +203,11 @@ void Paxos::collect(version_t oldpn)
collect_timeout_event = mon->timer.add_event_after(
g_conf()->mon_accept_timeout_factor *
g_conf()->mon_lease,
- new C_MonContext(mon, [this](int r) {
+ new C_MonContext{mon, [this](int r) {
if (r == -ECANCELED)
return;
collect_timeout();
- }));
+ }});
}
@@ -694,11 +694,11 @@ void Paxos::begin(bufferlist& v)
// set timeout event
accept_timeout_event = mon->timer.add_event_after(
g_conf()->mon_accept_timeout_factor * g_conf()->mon_lease,
- new C_MonContext(mon, [this](int r) {
+ new C_MonContext{mon, [this](int r) {
if (r == -ECANCELED)
return;
accept_timeout();
- }));
+ }});
}
// peon
@@ -995,11 +995,11 @@ void Paxos::extend_lease()
if (!lease_ack_timeout_event) {
lease_ack_timeout_event = mon->timer.add_event_after(
g_conf()->mon_lease_ack_timeout_factor * g_conf()->mon_lease,
- new C_MonContext(mon, [this](int r) {
+ new C_MonContext{mon, [this](int r) {
if (r == -ECANCELED)
return;
lease_ack_timeout();
- }));
+ }});
}
// set renew event
@@ -1008,11 +1008,11 @@ void Paxos::extend_lease()
at += ceph::make_timespan(g_conf()->mon_lease_renew_interval_factor *
g_conf()->mon_lease);
lease_renew_event = mon->timer.add_event_at(
- at, new C_MonContext(mon, [this](int r) {
+ at, new C_MonContext{mon, [this](int r) {
if (r == -ECANCELED)
return;
lease_renew_timeout();
- }));
+ }});
}
void Paxos::warn_on_future_time(utime_t t, entity_name_t from)
@@ -1198,11 +1198,11 @@ void Paxos::reset_lease_timeout()
mon->timer.cancel_event(lease_timeout_event);
lease_timeout_event = mon->timer.add_event_after(
g_conf()->mon_lease_ack_timeout_factor * g_conf()->mon_lease,
- new C_MonContext(mon, [this](int r) {
+ new C_MonContext{mon, [this](int r) {
if (r == -ECANCELED)
return;
lease_timeout();
- }));
+ }});
}
void Paxos::lease_timeout()