A convenience class used by some Decaf classes to implement the Synchronizable interface when there is no issues related to multiple inheritance.
More...
#include <src/main/decaf/internal/util/concurrent/SynchronizableImpl.h>
Public Member Functions |
| SynchronizableImpl () |
virtual | ~SynchronizableImpl () |
virtual void | lock () |
| Locks the object.
|
virtual bool | tryLock () |
| Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
|
virtual void | unlock () |
| Unlocks the object.
|
virtual void | wait () |
| Waits on a signal from this object, which is generated by a call to Notify.
|
virtual void | wait (long long millisecs) |
| Waits on a signal from this object, which is generated by a call to Notify.
|
virtual void | wait (long long millisecs, int nanos) |
| Waits on a signal from this object, which is generated by a call to Notify.
|
virtual void | notify () |
| Signals a waiter on this object that it can now wake up and continue.
|
virtual void | notifyAll () |
| Signals the waiters on this object that it can now wake up and continue.
|
virtual | ~Synchronizable () |
Detailed Description
A convenience class used by some Decaf classes to implement the Synchronizable interface when there is no issues related to multiple inheritance.
- Since
- 1.0
Constructor & Destructor Documentation
decaf::internal::util::concurrent::SynchronizableImpl::SynchronizableImpl |
( |
| ) |
|
virtual decaf::internal::util::concurrent::SynchronizableImpl::~SynchronizableImpl |
( |
| ) |
|
|
virtual |
Member Function Documentation
virtual void decaf::internal::util::concurrent::SynchronizableImpl::lock |
( |
| ) |
|
|
virtual |
virtual void decaf::internal::util::concurrent::SynchronizableImpl::notify |
( |
| ) |
|
|
virtual |
Signals a waiter on this object that it can now wake up and continue.
Must have this object locked before calling.
- Exceptions
-
IllegalMonitorStateException | - if the current thread is not the owner of the the Synchronizable Object. |
RuntimeException | if an error occurs while notifying one of the waiting threads. |
Implements decaf::util::concurrent::Synchronizable.
virtual void decaf::internal::util::concurrent::SynchronizableImpl::notifyAll |
( |
| ) |
|
|
virtual |
Signals the waiters on this object that it can now wake up and continue.
Must have this object locked before calling.
- Exceptions
-
IllegalMonitorStateException | - if the current thread is not the owner of the the Synchronizable Object. |
RuntimeException | if an error occurs while notifying the waiting threads. |
Implements decaf::util::concurrent::Synchronizable.
virtual bool decaf::internal::util::concurrent::SynchronizableImpl::tryLock |
( |
| ) |
|
|
virtual |
Attempts to Lock the object, if the lock is already held by another thread than this method returns false.
- Returns
- true if the lock was acquired, false if it is already held by another thread.
- Exceptions
-
RuntimeException | if an error occurs while locking the object. |
Implements decaf::util::concurrent::Synchronizable.
virtual void decaf::internal::util::concurrent::SynchronizableImpl::unlock |
( |
| ) |
|
|
virtual |
virtual void decaf::internal::util::concurrent::SynchronizableImpl::wait |
( |
| ) |
|
|
virtual |
Waits on a signal from this object, which is generated by a call to Notify.
Must have this object locked before calling.
- Exceptions
-
RuntimeException | if an error occurs while waiting on the object. |
InterruptedException | if the wait is interrupted before it completes. |
IllegalMonitorStateException | - if the current thread is not the owner of the the Synchronizable Object. |
Implements decaf::util::concurrent::Synchronizable.
virtual void decaf::internal::util::concurrent::SynchronizableImpl::wait |
( |
long long |
millisecs | ) |
|
|
virtual |
Waits on a signal from this object, which is generated by a call to Notify.
Must have this object locked before calling. This wait will timeout after the specified time interval.
- Parameters
-
millisecs | the time in milliseconds to wait, or WAIT_INIFINITE |
- Exceptions
-
RuntimeException | if an error occurs while waiting on the object. |
InterruptedException | if the wait is interrupted before it completes. |
IllegalMonitorStateException | - if the current thread is not the owner of the the Synchronizable Object. |
Implements decaf::util::concurrent::Synchronizable.
virtual void decaf::internal::util::concurrent::SynchronizableImpl::wait |
( |
long long |
millisecs, |
|
|
int |
nanos |
|
) |
| |
|
virtual |
Waits on a signal from this object, which is generated by a call to Notify.
Must have this object locked before calling. This wait will timeout after the specified time interval. This method is similar to the one argument wait function except that it add a finer grained control over the amount of time that it waits by adding in the additional nanosecond argument.
NOTE: The ability to wait accurately at a nanosecond scale depends on the platform and OS that the Decaf API is running on, some systems do not provide an accurate enough clock to provide this level of granularity.
- Parameters
-
millisecs | the time in milliseconds to wait, or WAIT_INIFINITE |
nanos | additional time in nanoseconds with a range of 0-999999 |
- Exceptions
-
IllegalArgumentException | if an error occurs or the nanos argument is not in the range of [0-999999] |
RuntimeException | if an error occurs while waiting on the object. |
InterruptedException | if the wait is interrupted before it completes. |
IllegalMonitorStateException | - if the current thread is not the owner of the the Synchronizable Object. |
Implements decaf::util::concurrent::Synchronizable.
The documentation for this class was generated from the following file: