IlsSafelyLockableEntity
 
IlsSafelyLockableEntity
Category 
Modeling class - API FOR ADVANCED USERS
Inheritance Path 
IlsEntity
IlsSafelyLockableEntity
Description 
This class is used with multithreaded applications. It lets you lock an entity several times in the same thread.
Library 
<server>
Header File 
#include <ilserver/model.h>
Synopsis 
class IlsSafelyLockableEntity:
public IlsEntity
{
public:
IlsBoolean lock();
IlsBoolean trylock();
IlsBoolean unlock();
};
Member Functions 
IlsBoolean lock();
This member function locks the entity. If the entity is locked by another thread, it will wait until the lock can be taken. The function returns IlsFalse if the operation fails.
An entity 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 entity. It returns IlsFalse if the lock cannot be taken. Unlike the function IlsSafelyLockableEntity::lock, it does not wait until the operation becomes possible. Within a thread, you can lock an entity repeatedly.
IlsBoolean unlock();
This member function unlocks the entity. An entity 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 
IlsLockableEntity, IlsThread

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