class basic_rwlock;
template<typename Clock = typename timer<>::clock>
-struct rwlock_for_read {
+class rwlock_for_read {
+public:
future<> lock() {
return static_cast<basic_rwlock<Clock>*>(this)->read_lock();
}
};
template<typename Clock = typename timer<>::clock>
-struct rwlock_for_write {
+class rwlock_for_write {
+public:
future<> lock() {
return static_cast<basic_rwlock<Clock>*>(this)->write_lock();
}
/// is called, one of the fibers waiting on \ref write_lock will be allowed
/// to proceed.
void read_unlock() {
-#ifdef SEASTAR_DEBUG_LOCKING
assert(_sem.current() < max_ops);
-#endif
_sem.signal();
}
/// is called, one of the other fibers waiting on \ref write_lock or the fibers
/// waiting on \ref read_lock will be allowed to proceed.
void write_unlock() {
-#ifdef SEASTAR_DEBUG_LOCKING
assert(_sem.current() == 0);
-#endif
_sem.signal(max_ops);
}