The ATS code uses that terminology.  The C++ Standard lib has
std::lock_guard .  If you are saying we should not transition to the stdlib
stuff, why?

The utility I'm proposing makes it a little more convenient to use a mutex
with lock_guards in typical cases that a mutex is used.  It also makes it
very clear what the mutex is protecting, and makes accessing the protected
data less error prone.  To me, it's a big problem in the ATS source base
that it's not clear how mutual exclusion to non-stack data is guaranteed.
When you see a mutex in our code, it's generally not clear what all it's
protecting.

On Wed, Mar 20, 2019 at 4:17 PM Leif Hedstrom <zw...@apache.org> wrote:

> Don’t we have scoped mutexes already ?
>
> — Leif
>
> > On Mar 20, 2019, at 12:08, Walt Karas <wka...@verizonmedia.com.invalid>
> wrote:
> >
> > https://godbolt.org/z/6klEJn
> >
> > Useful for mutex-protected objects, where the mutex is only locked within
> > code blocks.  Could be used in this PR:
> >
> > https://github.com/apache/trafficserver/pull/5187
>
>

Reply via email to