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

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

pivotal-jbarrett commented on a change in pull request #776:
URL: https://github.com/apache/geode-native/pull/776#discussion_r623970799



##########
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:
       We don't necessarily have to do it immediately. You could keep this in 
your back pocket as a future cleanup of this helper. I have wanted to fix this 
one for a while but just keep punting it myself. Your steps to make it boost 
based make it that much closer to reality though. Thanks!




-- 
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]


> 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.3.4#803005)

Reply via email to