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>
|
| 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.
|
|
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
Create a locking object for a Synchronized instance, which will be locked by calling this constructor.
- Parameters
-
The destructor will release the lock on the sync object.
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
-
timeout | timeout in milliseconds. |
The documentation for this class was generated from the following file: