equal
deleted
inserted
replaced
90 mutable volatile int _refs; |
90 mutable volatile int _refs; |
91 public: |
91 public: |
92 MultiThreadedRefCounter() : _refs(0) {} |
92 MultiThreadedRefCounter() : _refs(0) {} |
93 |
93 |
94 void inc() const { |
94 void inc() const { |
95 Atomic::add(1, &_refs); |
95 Atomic::add(&_refs, 1); |
96 } |
96 } |
97 |
97 |
98 bool dec() const { |
98 bool dec() const { |
99 return 0 == Atomic::add((-1), &_refs); |
99 return 0 == Atomic::add(&_refs, (-1)); |
100 } |
100 } |
101 |
101 |
102 int current() const { |
102 int current() const { |
103 return _refs; |
103 return _refs; |
104 } |
104 } |