mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
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:
parent
fb7831c301
commit
635bbe839f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user