Rogue Wave Server
API Reference Guide
Product Documentation:

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

API FOR ADVANCED USERS – This class is used with multithreaded applications. It lets you lock an object several times in the same thread. More...

#include <ilserver/model.h>

Inheritance diagram for IlsSafelyLockableObject:
IlsObject

Public Member Functions

IlsBoolean lock ()
 Locks the object. More...
 
IlsBoolean trylock ()
 Tries to lock the object. More...
 
IlsBoolean unlock ()
 Unlocks the object. More...
 
- Public Member Functions inherited from IlsObject
virtual ~IlsObject ()
 Virtual destructor.
 
virtual void cut (ILS_CUT_DIRECTIVE=ILS_ALL)
 Cuts all relations of which the object is the target. More...
 
virtual IlsEntitygetEntity ()
 Returns a pointer to the entity that owns the object transitively.
 
IlsBoolean isInserted ()
 Indicates whether the object is owned or not.
 
IlsBoolean remove ()
 Cuts the object and always returns IlsTrue. More...
 
virtual IlsBoolean isUpdateAllowed ()
 By default, this virtual member function checks whether the object is the target of an ownership relation. More...
 
IlsBoolean isOwnerModified ()
 During a notification phase, this member function returns IlsTrue if the owner of the object has changed since the last notification phase.
 
IlsBoolean areUsersModified ()
 During a notification phase, this member function returns IlsTrue if a use relation has been added or removed since the last notification phase.
 

Detailed Description

API FOR ADVANCED USERS – This class is used with multithreaded applications. It lets you lock an object several times in the same thread.

Library: server

See also
IlsLockableObject, IlsSafelyLockableEntity, IlsThread.

Member Function Documentation

§ lock()

IlsBoolean IlsSafelyLockableObject::lock ( )
virtual

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().

Reimplemented from IlsObject.

§ trylock()

IlsBoolean IlsSafelyLockableObject::trylock ( )
virtual

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.

Reimplemented from IlsObject.

§ unlock()

IlsBoolean IlsSafelyLockableObject::unlock ( )
virtual

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.

Reimplemented from IlsObject.


© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.