IlsUnsafeMutexLocker
Category
Thread utility class - API FOR ADVANCED USERS
Inheritance Path
IlsUnsafeMutexLocker
Description
IlsUnsafeMutexLocker is a wrapper class. A wrapper is a class that locks the mutex in the constructor or when the mutex is assigned and unlocks the mutex in the destructor, if assigned.
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.
Libraries
Synopsis
class IlsUnsafeMutexLocker
{
public:
IlsUnsafeMutexLocker(IlsUnsafeMutex* = 0);
virtual ~IlsUnsafeMutexLocker();
void assign(IlsUnsafeMutex* = 0);
};
Constructor
IlsUnsafeMutexLocker(IlsUnsafeMutex* = 0);
The pointer to the mutex must be passed to the constructor, if the constructor is to lock the mutex.
Destructor
virtual ~IlsUnsafeMutexLocker();
Member Function
void assign(IlsUnsafeMutex* = 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.
See Also
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.