#include <threads.h>
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. |
The execution of the critical section can be suspended by calling the wait function.
Lock::Lock | ( | Synchronized & | s | ) | [inline] |
Create a locking object for a Synchronized instance, which wll be locked by calling this constructor.
sync | a Synchronized instance. |
Lock::~Lock | ( | ) | [inline] |
The destructor will release the lock on the sync object.
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.
timeout | timeout in milliseconds. |
void Lock::notify | ( | ) | [inline] |
Wakes up a single thread that is waiting on this object's monitor.