Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
AO_t val;
public:
atomic_t(AO_t i=0) : val(i) {}
- void inc() {
- AO_fetch_and_add1(&val);
+ AO_t inc() {
+ return AO_fetch_and_add1(&val) + 1;
}
AO_t dec() {
return AO_fetch_and_sub1_write(&val) - 1;
messenger->add_dispatcher_head(this);
- rados_instance.inc();
- nonce = getpid() + (1000000 * (uint64_t)rados_instance.read());
+ nonce = getpid() + (1000000 * (uint64_t)rados_instance.inc());
messenger->start_with_nonce(nonce);
messenger->add_dispatcher_head(this);