Neil Rhodes wrote:
> my choice is to always call MemHandleUnlock, since I find it easier
> to verify my MemHandleLocks have a matching MemHandleUnlock while 
> perusing my code.

This is where a little C++ can really help.  Instead of manually coding
lock/unlock pairs, you can have a helper class that does this for you
automatically via its constructor and destructor, at least for locks and
unlocks that happen within the same scope.  The same can be done for
other paired operations like getting/releasing records.

See Stroustrup 3rd Ed. section 14.4 on "Resource Management".

-slj-

Reply via email to