so RWLock can be used with std::shared_lock,
rgw is using RWLock'prioritize_write feature, which is not offered by
std::shared_mutex, but we want to unify the way we use mutex, so add
these helper functions.
Signed-off-by: Kefu Chai <kchai@redhat.com>
void put_read() const {
unlock();
}
-
+ void lock_shared() {
+ get_read();
+ }
+ void unlock_shared() {
+ put_read();
+ }
// write
void get_write(bool lockdep=true) {
if (lockdep && this->lockdep && g_lockdep)
void put_write() {
unlock();
}
-
+ void lock() {
+ get_write();
+ }
void get(bool for_write) {
if (for_write) {
get_write();