Changeset View
Changeset View
Standalone View
Standalone View
src/rcu.h
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | public: | ||||
friend bool operator!=(const RCUPtr &lhs, const RCUPtr &rhs) { | friend bool operator!=(const RCUPtr &lhs, const RCUPtr &rhs) { | ||||
return !(lhs == rhs); | return !(lhs == rhs); | ||||
} | } | ||||
/** | /** | ||||
* ostream support. | * ostream support. | ||||
*/ | */ | ||||
friend std::ostream &operator<<(std::ostream &stream, const RCUPtr &ptr) { | friend std::ostream &operator<<(std::ostream &stream, const RCUPtr &optr) { | ||||
deadalnix: rhs | |||||
return stream << ptr.ptr; | return stream << optr.ptr; | ||||
} | } | ||||
}; | }; | ||||
#define IMPLEMENT_RCU_REFCOUNT(T) \ | #define IMPLEMENT_RCU_REFCOUNT(T) \ | ||||
private: \ | private: \ | ||||
mutable std::atomic<T> refcount{0}; \ | mutable std::atomic<T> refcount{0}; \ | ||||
\ | \ | ||||
void acquire() const { refcount++; } \ | void acquire() const { refcount++; } \ | ||||
Show All 32 Lines |
rhs