All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AutoLocker Class Reference

provides a safe and exception-safe way to hold locks in Qore, only to be used on the stack, cannot be dynamically allocated More...

`#include <QoreThreadLock.h>`

Collaboration diagram for AutoLocker:
[legend]

## Public Member Functions

DLLLOCAL | AutoLocker (QoreThreadLock *l)
| creates the object and grabs the lock
DLLLOCAL | AutoLocker (QoreThreadLock &l)
| creates the object and grabs the lock
DLLLOCAL | ~AutoLocker ()
| destroys the object and releases the lock

## Protected Attributes

QoreThreadLock * | lck
| the pointer to the lock that will be managed

## Detailed Description

provides a safe and exception-safe way to hold locks in Qore, only to be used on the stack, cannot be dynamically allocated

Ensures that locks are released by locking the lock when the object is created and releasing it when the object is destroyed. For a similar object that allows for unlocking the lock earlier than the object's destruction, see SafeLocker.

See Also
  AutoUnlocker
  SafeLocker
  OptLocker

The documentation for this class was generated from the following file:

- include/qore/QoreThreadLock.h (79e5dd4f976dab9d74ec8272aec97c21df86c597)