Github user pivotal-jbarrett commented on a diff in the pull request:

    https://github.com/apache/geode-native/pull/74#discussion_r108006001
  
    --- Diff: src/cppcache/src/ThinClientPoolDM.cpp ---
    @@ -609,7 +609,8 @@ GfErrType ThinClientPoolDM::sendRequestToAllServers(
       HostAsm::atomicAdd(m_clientOps, 1);
       getStats().setCurClientOps(m_clientOps);
     
    -  ACE_Recursive_Thread_Mutex resultCollectorLock;
    +  std::shared_ptr<ACE_Recursive_Thread_Mutex> resultCollectorLock(
    +      new ACE_Recursive_Thread_Mutex());
    --- End diff --
    
    The proper way to allocate a new object into a shared pointer:
    ```
    auto resultCollectorLock = std::make_shared<ACE_Recursive_Thread_Mutex>();
    ```
    
    This results in a single allocations (combined control block and object) 
rather than two (control block and object).



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to