atomic_t: update spinlock implementation.

Somebody added a 'set' function without adding the non-atomic_ops
version!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This commit is contained in:
Greg Farnum 2011-08-19 09:15:42 -07:00
parent fb7831c301
commit 635bbe839f

View File

@ -76,6 +76,11 @@ namespace ceph {
~atomic_t() {
pthread_spin_destroy(&lock);
}
void set(size_t v) {
pthread_spin_lock(&lock);
int r = v;
pthread_spin_unlock(&lock);
}
int inc() {
pthread_spin_lock(&lock);
int r = ++val;