diff options
| author | Alan Conway <aconway@apache.org> | 2007-07-16 17:52:01 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-07-16 17:52:01 +0000 |
| commit | 760b6368e37758cecba177cd9cb80a676301f3bc (patch) | |
| tree | 0ffe41c4a898cee176a144abece1bd91b034ed52 /cpp/src/qpid/sys/apr | |
| parent | 2ff308902e33298bc78af0b9af3ca9262ee2b56d (diff) | |
| download | qpid-python-760b6368e37758cecba177cd9cb80a676301f3bc.tar.gz | |
* src/qpid/sys/Serializer.h: Serialize calls to a function,
by queueing and dispatching in a separate thread if necessary.
* src/qpid/sys/*/Mutex.h: trylock to return a bool.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@556679 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/apr')
| -rw-r--r-- | cpp/src/qpid/sys/apr/Mutex.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cpp/src/qpid/sys/apr/Mutex.h b/cpp/src/qpid/sys/apr/Mutex.h index 6679adeebb..51089c98ff 100644 --- a/cpp/src/qpid/sys/apr/Mutex.h +++ b/cpp/src/qpid/sys/apr/Mutex.h @@ -42,7 +42,7 @@ class Mutex : private boost::noncopyable { inline ~Mutex(); inline void lock(); inline void unlock(); - inline void trylock(); + inline bool trylock(); protected: apr_thread_mutex_t* mutex; @@ -64,8 +64,8 @@ void Mutex::unlock() { CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex)); } -void Mutex::trylock() { - CHECK_APR_SUCCESS(apr_thread_mutex_trylock(mutex)); +bool Mutex::trylock() { + return apr_thread_mutex_trylock(mutex) == 0; } @@ -84,8 +84,8 @@ public: inline void wlock(); // will write-lock inline void rlock(); // will read-lock inline void unlock(); - inline void trywlock(); // will write-try - inline void tryrlock(); // will read-try + inline bool trywlock(); // will write-try + inline bool tryrlock(); // will read-try protected: apr_thread_mutex_t* mutex; @@ -111,12 +111,12 @@ void RWlock::unlock() { CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex)); } -void RWlock::trywlock() { - CHECK_APR_SUCCESS(apr_thread_mutex_trylock(mutex)); +bool RWlock::trywlock() { + return apr_thread_mutex_trylock(mutex) == 0; } -void RWlock::tryrlock() { - CHECK_APR_SUCCESS(apr_thread_mutex_trylock(mutex)); +bool RWlock::tryrlock() { + return apr_thread_mutex_trylock(mutex) == 0; } |
