Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
ThreadReleaseLock Struct Reference

Detailed Description

This class provides an easy and less error-prone way of temporarily releasing a locked mutex.

This class is the inverse of class ThreadLock.

// Inside a request handler entered with the dispatcher mutex held:
{
ThreadReleaseLock rlock(request);
// Perform blocking application work here, without calling BAS APIs
// or accessing shared BAS objects while their mutex is released.
} // The same mutex is acquired again before BAS work resumes.
This class provides an easy and less error-prone way of temporarily releasing a locked mutex.
Definition: ThreadLib.h:157
See also
ThreadMutex ThreadLock

#include <ThreadLib.h>

Public Member Functions

 ThreadReleaseLock (struct HttpRequest *req)
 Temporarily release the owned mutex; reacquire at scope exit. More...
 
 ThreadReleaseLock (ThreadMutex &m)
 Temporarily release the owned mutex; reacquire at scope exit. More...
 
 ThreadReleaseLock (ThreadMutex *m)
 Temporarily release the owned mutex; reacquire at scope exit. More...
 
 ThreadReleaseLock (ThreadLock &tl)
 Temporarily release the owned mutex; reacquire at scope exit. More...
 
 ThreadReleaseLock (ThreadLock *tl)
 Temporarily release the owned mutex; reacquire at scope exit. More...
 
 ~ThreadReleaseLock ()
 Reacquire the same mutex before leaving scope. More...