[ https://issues.apache.org/jira/browse/TS-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14205446#comment-14205446 ]
Alan M. Carroll commented on TS-3156: ------------------------------------- It doesn't take ownership, but it does hold a reference so the mutex can't evaporate before the destructor is called. This is generally a good idea if you need to access a smart pointer protected resource later. On Monday, November 10, 2014 12:43 PM, Powell Molleti (JIRA) <j...@apache.org> wrote: [ https://issues.apache.org/jira/browse/TS-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14205141#comment-14205141 ] Powell Molleti commented on TS-3156: ------------------------------------ Alan/Lief, Any idea why MutexLock in iocore/eventsystem/I_Lock.h uses smart ptr for the actual lock?. Scoped/Autolock code should not take ownership of the lock it should just do a lock() (in constructor) and unlock() (in destructor). Reference: boost_1_57_0/boost/interprocess/sync/scoped_lock.hpp Powell. -- This message was sent by Atlassian JIRA (v6.3.4#6332) > Mutex[Try]Lock bool() operator change and unused API removal > ------------------------------------------------------------ > > Key: TS-3156 > URL: https://issues.apache.org/jira/browse/TS-3156 > Project: Traffic Server > Issue Type: Improvement > Components: Core > Reporter: Powell Molleti > Assignee: James Peach > Priority: Minor > Labels: review > Fix For: 5.2.0 > > Attachments: MutexLock-ats.patch, MutexLock-ats.patch, > Use-Ryo-s-patch-to-pass-shared_ptr-to-MutexLock.patch, fix-MutexLock.patch > > > Removed unused constructor in MutexLock along with set_and_take() method, had > to change FORCE_PLUGIN_MUTEX() for that. Removed release() method. > default bool and ! operator from both MutexLock and MutexTryLock with > is_locked() API. Changes if (lock) to if (lock.is_locked()) across the code > base. > Ran make test will be performing more system testing. Posted before for early > comments / feedback. -- This message was sent by Atlassian JIRA (v6.3.4#6332)