t.encode(bl);
// apply to paxos
- proposing.set(1);
+ proposing = true;
paxos->propose_new_value(bl, new C_Committed(this));
}
discard_pending();
have_pending = false;
}
- proposing.set(0);
+ proposing = false;
finish_contexts(g_ceph_context, waiting_for_finished_proposal, -EAGAIN);
* If we are or have queued anything for proposal, this variable will be true
* until our proposal has been finished.
*/
- atomic_t proposing;
+ bool proposing;
protected:
/**
public:
C_Committed(PaxosService *p) : ps(p) { }
void finish(int r) {
- ps->proposing.set(0);
+ ps->proposing = false;
if (r >= 0)
ps->_active();
else if (r == -ECANCELED || r == -EAGAIN)
*/
PaxosService(Monitor *mn, Paxos *p, string name)
: mon(mn), paxos(p), service_name(name),
+ proposing(false),
service_version(0), proposal_timer(0), have_pending(false),
trim_version(0),
last_committed_name("last_committed"),
mkfs_name("mkfs"),
full_version_name("full"), full_latest_name("latest")
{
- proposing.set(0);
}
virtual ~PaxosService() {}
* @returns true if we are proposing; false otherwise.
*/
bool is_proposing() {
- return ((int) proposing.read() == 1);
+ return proposing;
}
/**