A simple yet effective use of this class is to declare a local object of this class that is in scope for the period of time that the resource needs to be locked. The lock is automatically removed when the block of code is exited, thereby forcing the object out of scope.
If the specified period of time is reached before the resource can be acquired, an IResourceExhausted exception is thrown.
Constructors & DestructorUse these members to construct and destruct objects of this class.
![]() |
public:
virtual ~IResourceLock()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IResourceLock(IResource& resource, long timeOut = - 1)
| IOutOfSystemResource | The request failed because of a lock time out. (DD) IAccessError Unexpected error while accessing underlying system object. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
The AIX timer services used to implement the resource lock timeOut have a resolution of one second. The timeout values you provide are rounded up to the next one-second interval.
virtual IResourceLock& clearLock()
virtual IResourceLock& setLock(long timeOut = - 1)