gaussianrecurrence commented on a change in pull request #776:
URL: https://github.com/apache/geode-native/pull/776#discussion_r623786676
##########
File path: cppcache/src/ReadWriteLock.cpp
##########
@@ -23,28 +23,28 @@ namespace apache {
namespace geode {
namespace client {
-TryReadGuard::TryReadGuard(ACE_RW_Thread_Mutex& lock,
- const volatile bool& exitCondition)
- : lock_(lock), isAcquired_(false) {
+TryReadGuard::TryReadGuard(boost::shared_mutex& mutex,
+ const volatile bool& exit_cond)
+ : mutex_{mutex}, locked_{false} {
do {
- if (lock_.tryacquire_read() != -1) {
- isAcquired_ = true;
+ if (mutex_.try_lock_shared()) {
+ locked_ = true;
break;
}
std::this_thread::yield();
- } while (!exitCondition);
+ } while (!exit_cond);
}
-TryWriteGuard::TryWriteGuard(ACE_RW_Thread_Mutex& lock,
- const volatile bool& exitCondition)
- : lock_(lock), isAcquired_(false) {
+TryWriteGuard::TryWriteGuard(boost::shared_mutex& mutex,
+ const volatile bool& exit_cond)
+ : mutex_{mutex}, locked_{false} {
Review comment:
You definetly have a point. This will require quite some changes, but
I'll make it work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]