[ 
https://issues.apache.org/jira/browse/GEODE-9078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18102308#comment-18102308
 ] 

ASF GitHub Bot commented on GEODE-9078:
---------------------------------------

m3i54 commented on code in PR #776:
URL: https://github.com/apache/geode-native/pull/776#discussion_r623786676


##########
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.



##########
cppcache/src/RemoteQuery.cpp:
##########
@@ -125,7 +125,7 @@ GfErrType RemoteQuery::executeNoThrow(
     ThinClientBaseDM* tcdm, std::shared_ptr<CacheableVector> paramList) {
   LOGFINEST("%s: executing query: %s", func, m_queryString.c_str());
 
-  TryReadGuard guard(m_queryService->getLock(), m_queryService->invalid());
+  TryReadGuard guard(m_queryService->getMutex(), m_queryService->invalid());

Review Comment:
   Totally agree. Will do that.





> Remove ACE mutexes
> ------------------
>
>                 Key: GEODE-9078
>                 URL: https://issues.apache.org/jira/browse/GEODE-9078
>             Project: Geode
>          Issue Type: Task
>          Components: native client
>            Reporter: Mario Salazar de Torres
>            Assignee: Mario Salazar de Torres
>            Priority: Major
>              Labels: obliterate-ace, pull-request-available
>
> *AS AN* geode-native contributor
>  *I WANT TO* remove all occurrences of ACE mutexes
>  *SO THAT* we can get rid of ACE for good



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to