Server
API Reference Guide
Product Documentation:

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

API FOR ADVANCED USERS – This class is used with multithreaded applications. It lets you lock an object once within a thread. More...

#include <ilserver/model.h>

Inheritance diagram for IlsLockableObject:
IlsObject

Public Member Functions

IlsBoolean lock ()
 
IlsBoolean trylock ()
 
IlsBoolean unlock ()
 
- Public Member Functions inherited from IlsObject
virtual ~IlsObject ()
 Virtual destructor.
 
virtual void cut (ILS_CUT_DIRECTIVE=ILS_ALL)
 
IlsBoolean isInserted ()
 Indicates whether the object is owned or not.
 
IlsBoolean remove ()
 
virtual IlsBoolean isUpdateAllowed ()
 
virtual IlsBoolean isUsePossible ()
 Locks the object.
 
virtual IlsBoolean isAlreadyInHierarchy (void *)
 Locks the object.
 
virtual IlsEntitygetEntity ()
 
void setEntityContext (IlsEntityContext &)
 Locks the object.
 
void unsetEntityContext (IlsEntityContext &)
 Locks the object.
 
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 once within a thread.

Library: server

This type of lock is riskier than the type of lock defined using IlsSafelyLockableObject but offers better performance.

See also
IlsSafelyLockableObject, IlsThread.

Member Function Documentation

◆ lock()

IlsBoolean IlsLockableObject::lock ( )
virtual
\short 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.

Reimplemented from IlsObject.

◆ trylock()

IlsBoolean IlsLockableObject::trylock ( )
virtual
\short 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.

Reimplemented from IlsObject.

◆ unlock()

IlsBoolean IlsLockableObject::unlock ( )
virtual
\short 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.

Reimplemented from IlsObject.