IlsLockableObject
 
IlsLockableObject
Category 
Modeling class - API FOR ADVANCED USERS
Inheritance Path 
IlsObject
IlsLockableObject
Description 
This class is used with multithreaded applications. It lets you lock an object once within a thread. This type of lock is riskier than the type of lock defined using IlsSafelyLockableObject but offers better performance.
Library 
<server> and <mvcomp>
Header File 
#include <ilserver/model.h>
Synopsis 
class IlsLockableObject:
public IlsObject
{
public:
IlsBoolean lock();
IlsBoolean trylock();
IlsBoolean unlock();
};
Member Functions 
IlsBoolean lock();
This member function locks the object. If the object is locked by another thread, it waits until the lock can be taken. It returns IlsFalse if the operation fails.
An object cannot be locked several times by the same thread.
IlsBoolean trylock();
This member function tries to lock the object. It returns IlsFalse if the lock cannot be taken. Unlike the function lock described above, it does not wait until the operation becomes possible.
IlsBoolean unlock();
This member function unlocks the object. An object can be unlocked:
*Only by the thread that locked it.
*Only if it has been locked first.
This function returns IlsFalse if an error occurs.
See Also 
IlsSafelyLockableObject, IlsThread

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.