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>

List of all members.

Public Member Functions

 Lock (Synchronized &s)
 Create a locking object for a Synchronized instance, which wll 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 wll be locked by calling this constructor.

Parameters:
sync a Synchronized instance.

Lock::~Lock (  )  [inline]

The destructor will release the lock on the sync object.


Member Function Documentation

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:
timeout timeout in milliseconds.

void Lock::notify (  )  [inline]

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


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

Generated on Fri May 29 22:36:54 2009 for AGENT++ by  doxygen 1.5.6