aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/re2/util/mutex.h
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-01 14:26:09 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-01 14:26:09 +0300
commitce595f945b861180f6b229905dfd6e5f49fe19fe (patch)
tree89af7824eeba43d73d0ca09fccb6f05c2984ed84 /contrib/libs/re2/util/mutex.h
parent0e85e9e3a7daeae8354364dff1241ed2511d1461 (diff)
downloadydb-ce595f945b861180f6b229905dfd6e5f49fe19fe.tar.gz
intermediate changes
ref:04088b5ce70b83f5eaf307a1743e0179beaeb170
Diffstat (limited to 'contrib/libs/re2/util/mutex.h')
-rw-r--r--contrib/libs/re2/util/mutex.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/libs/re2/util/mutex.h b/contrib/libs/re2/util/mutex.h
index 158046bb5c..4b6772ae22 100644
--- a/contrib/libs/re2/util/mutex.h
+++ b/contrib/libs/re2/util/mutex.h
@@ -33,8 +33,8 @@ typedef SRWLOCK MutexType;
#include <stdlib.h>
typedef pthread_rwlock_t MutexType;
#else
-#include <mutex>
-typedef std::mutex MutexType;
+#include <shared_mutex>
+typedef std::shared_mutex MutexType;
#endif
namespace re2 {
@@ -95,8 +95,8 @@ Mutex::Mutex() { }
Mutex::~Mutex() { }
void Mutex::Lock() { mutex_.lock(); }
void Mutex::Unlock() { mutex_.unlock(); }
-void Mutex::ReaderLock() { Lock(); } // C++11 doesn't have std::shared_mutex.
-void Mutex::ReaderUnlock() { Unlock(); }
+void Mutex::ReaderLock() { mutex_.lock_shared(); }
+void Mutex::ReaderUnlock() { mutex_.unlock_shared(); }
#endif