Qore Programming Language  0.9.3
AutoVLock Class Reference

AutoVLock is a container for safely managing global variable and object lock handovers, required for functions accessing global variables and object data where locking is necessary. More...

#include <AutoVLock.h>

Collaboration diagram for AutoVLock:

Public Member Methods

DLLEXPORT AutoVLock (ExceptionSink *n_xsink)
 creates an empty lock container More...
 
DLLEXPORT AutoVLock (AutoVLock &&o)=default
 default move constructor
 
DLLEXPORT ~AutoVLock ()
 releases all locks held and destroys the container
 
DLLLOCAL void addMemberNotification (QoreObject *o, const char *member)
 adds an object member notification entry, internal-only More...
 
DLLLOCAL void clear ()
 leaves the lock locked and the object referenced and clears the object and lock pointers
 
DLLEXPORT void del ()
 manually releases the lock currently held
 
DLLLOCAL QoreObjectgetObject () const
 gets the current object
 
DLLLOCAL QoreVarRWLock * getRWL () const
 gets the current read-write lock
 
DLLEXPORT operator bool () const
 returns true if managing a lock, false if not (unlocked)
 
DLLLOCAL void set (QoreVarRWLock *n_rwl)
 sets the current lock
 
DLLLOCAL void set (QoreObject *n_o, QoreVarRWLock *n_rwl)
 sets the current object (for dereference) and lock
 

Detailed Description

AutoVLock is a container for safely managing global variable and object lock handovers, required for functions accessing global variables and object data where locking is necessary.

This object is used for lock handover management and automatically releasing the last lock.

Constructor & Destructor Documentation

◆ AutoVLock()

DLLEXPORT AutoVLock::AutoVLock ( ExceptionSink n_xsink)

creates an empty lock container

Parameters
n_xsinkpointer to ExceptionSink object for use with object notifications

Member Function Documentation

◆ addMemberNotification()

DLLLOCAL void AutoVLock::addMemberNotification ( QoreObject o,
const char *  member 
)

adds an object member notification entry, internal-only

Parameters
othe object to add
memberthe member that was changed (must be in QCS_DEFAULT encoding)

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