Use objects of the ITreeCollectionGuard class to ensure the thread safety of a tree collection in a multithreaded program.
The guard object makes sure that only one thread at a time accesses a collection, by locking the collection and preventing other threads from accessing it.
The guard object must be destroyed prior to the destruction of the corresponding collection.
Constructors & DestructorUse these member functions to construct or destruct objects of the class.
![]() |
public:
~ITreeCollectionGuard()
Unlocks the collection specified within the constructor of this guard.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
ITreeCollectionGuard( IATree < Element >&, long timeout = - 1 )
The constructor takes the collection object to be locked and an optional timeout value as parameters. The timeout value is specified in milliseconds. If a lock request cannot be resolved within the specified range of time, an exception is thrown. The timeout value defaults to -1. On POSIX systems this parameter is ignored.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |