On Fri, Jan 20, 2017 at 9:08 PM, Rene Gollent <anevilyak@xxxxxxxxx> wrote:
On Fri, Jan 20, 2017 at 3:07 PM, Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
wrote:
Why it's more error prone? Keeping the Autolocker alive is not anything
useful either.
Yes it is, for the simple reason that the compiler automatically
ensures that the lock is released when the locker goes out of scope
(since Autolocker's destructor deals with making that call).
In yourNo danger someone will mess with it, it's just a safe lock on startup and
new code, if someone modifies it in the future in some more
complicated way, one can easily forget an Unlock(), leading to later
hard-to-debug errors. Autolocker doesn't exist just for fun.
Rene