#include <Mutex.h>


Definition at line 88 of file Mutex.h.
Public Types | |
| typedef Poco::ScopedLock< Mutex > | ScopedLock |
Public Member Functions | |
| Mutex () | |
| ~Mutex () | |
| creates the Mutex. | |
| void | lock () |
| destroys the Mutex. | |
| void | lock (long milliseconds) |
| Locks the mutex. Blocks if the mutex is held by another thread. | |
| bool | tryLock () |
| Locks the mutex. Blocks up to the given number of milliseconds if the mutex is held by another thread. Throws a TimeoutException if the mutex can not be locked within the given timeout. | |
| bool | tryLock (long milliseconds) |
| Tries to lock the mutex. Returns false immediately if the mutex is already held by another thread. Returns true if the mutex was successfully locked. | |
| void | unlock () |
| Locks the mutex. Blocks up to the given number of milliseconds if the mutex is held by another thread. Returns true if the mutex was successfully locked. | |
Private Member Functions | |
| Mutex (const Mutex &) | |
| Unlocks the mutex so that it can be acquired by other threads. | |
| Mutex & | operator= (const Mutex &) |
| typedef Poco::ScopedLock<Mutex> Poco::Mutex::ScopedLock |
| Poco::Mutex::Mutex | ( | const Mutex & | ) | [private] |
Unlocks the mutex so that it can be acquired by other threads.
| void Poco::Mutex::lock | ( | ) | [inline] |
| void Poco::Mutex::lock | ( | long | milliseconds | ) | [inline] |
Locks the mutex. Blocks if the mutex is held by another thread.
Definition at line 208 of file Mutex.h.
References Poco::MutexImpl::tryLockImpl().
| bool Poco::Mutex::tryLock | ( | ) | [inline] |
Locks the mutex. Blocks up to the given number of milliseconds if the mutex is held by another thread. Throws a TimeoutException if the mutex can not be locked within the given timeout.
Performance Note: On most platforms (including Windows), this member function is implemented using a loop calling (the equivalent of) tryLock() and Thread::sleep(). On POSIX platforms that support pthread_mutex_timedlock(), this is used.
Definition at line 215 of file Mutex.h.
References Poco::MutexImpl::tryLockImpl().
| bool Poco::Mutex::tryLock | ( | long | milliseconds | ) | [inline] |
Tries to lock the mutex. Returns false immediately if the mutex is already held by another thread. Returns true if the mutex was successfully locked.
Definition at line 221 of file Mutex.h.
References Poco::MutexImpl::tryLockImpl().
| void Poco::Mutex::unlock | ( | ) | [inline] |
Locks the mutex. Blocks up to the given number of milliseconds if the mutex is held by another thread. Returns true if the mutex was successfully locked.
Performance Note: On most platforms (including Windows), this member function is implemented using a loop calling (the equivalent of) tryLock() and Thread::sleep(). On POSIX platforms that support pthread_mutex_timedlock(), this is used.
Definition at line 227 of file Mutex.h.
References Poco::MutexImpl::unlockImpl().