IlsSafelyLockableObject
 
IlsSafelyLockableObject
Category 
Modeling class - API FOR ADVANCED USERS
Inheritance Path 
IlsObject
IlsSafelyLockableObject
Description 
This class is used with multithreaded applications. It lets you lock an object several times in the same thread.
Libraries 
<server>
Header File 
#include <ilserver/model.h>
Synopsis 
class IlsSafelyLockableObject:
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 will wait until the lock can be taken. The function returns IlsFalse if the operation fails.
An object can be locked several times provided that the number of calls to lock equals the number of calls to unlock.
IlsBoolean trylock();
This member function tries to lock the object. It returns IlsFalse if the lock cannot be taken. Unlike the function IlsSafelyLockableObject::lock, it does not wait until the operation becomes possible. Within a thread, you can lock an object repeatedly.
IlsBoolean unlock();
This member function unlocks the object. An object can be unlocked only by the thread that locked it. An object can be unlocked only if it has been locked first. This function returns IlsFalse if an error occurs.
See Also 
IlsLockableObject, IlsThread

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