Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Public Member Functions
IlsUnsafeMutexLocker Class Reference

API FOR ADVANCED USERS – This class is a wrapper class that locks the mutex in the constructor or when the mutex is assigned and unlocks the mutex in the destructor, if assigned. More...

#include <ilserver/ilthread.h>

Public Member Functions

 IlsUnsafeMutexLocker (IlsUnsafeMutex *m=0)
 Constructor. More...
 
 ~IlsUnsafeMutexLocker ()
 The destructor unlocks the mutex if it is non-null.
 
void assign (IlsUnsafeMutex *m=0)
 This member function assigns the mutex. More...
 

Detailed Description

API FOR ADVANCED USERS – This class is a wrapper class that locks the mutex in the constructor or when the mutex is assigned and unlocks the mutex in the destructor, if assigned.

Library: server
and mvcomp

The wrapper must not be used among multiple threads; only the pointer to the mutex that is being locked can be shared among different threads. This class is normally used as a local variable within a procedure.

See also
IlsSafeMutex, IlsSafeMutexLocker, IlsThread, IlsUnsafeMutex.

Constructor & Destructor Documentation

◆ IlsUnsafeMutexLocker()

IlsUnsafeMutexLocker::IlsUnsafeMutexLocker ( IlsUnsafeMutex m = 0)

Constructor.

The pointer to the mutex must be passed to the constructor, if the constructor is to lock the mutex.

Member Function Documentation

◆ assign()

void IlsUnsafeMutexLocker::assign ( IlsUnsafeMutex m = 0)

This member function assigns the mutex.

The mutex can be assigned at any time. Setting the assigned mutex to zero will prevent the mutex from being unlocked when the mutex wrapper is destroyed.

Assigning a mutex will cause the old mutex, if any, to be unlocked and the new mutex, if any, to be locked.