Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Counter {
return atomic_add64(&val_,-1) - 1;
}
int64_t Get() const {
return val_;
return atomic_comp_swap(&val_, 0, 0);
}
int64_t Set(int64_t v) {
return atomic_swap64(&val_, v);
Expand Down