AGENT++  4.0.3
Public Member Functions | List of all members
Lock Class Reference

The Lock class implements a synchronization object, that when created enters the critical section of the given Synchronized object and leaves it when the Lock object is destroyed. More...

#include <threads.h>

Public Member Functions

 Lock (Synchronized &s)
 Create a locking object for a Synchronized instance, which will be locked by calling this constructor.
 
 ~Lock ()
 The destructor will release the lock on the sync object.
 
void wait (long timeout)
 Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.
 
void notify ()
 Wakes up a single thread that is waiting on this object's monitor.
 

Detailed Description

The Lock class implements a synchronization object, that when created enters the critical section of the given Synchronized object and leaves it when the Lock object is destroyed.

The execution of the critical section can be suspended by calling the wait function.

Author
Frank Fock
Version
3.5

Constructor & Destructor Documentation

Lock::Lock ( Synchronized s)
inline

Create a locking object for a Synchronized instance, which will be locked by calling this constructor.

Parameters
synca Synchronized instance.
Lock::~Lock ( )
inline

The destructor will release the lock on the sync object.

Member Function Documentation

void Lock::notify ( )
inline

Wakes up a single thread that is waiting on this object's monitor.

void Lock::wait ( long  timeout)
inline

Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.

Parameters
timeouttimeout in milliseconds.

The documentation for this class was generated from the following file: