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/posix | |
| 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/posix')
| -rw-r--r-- | cpp/src/qpid/sys/posix/Mutex.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/qpid/sys/posix/Mutex.h b/cpp/src/qpid/sys/posix/Mutex.h index b29219235d..4cf0c3a3b0 100644 --- a/cpp/src/qpid/sys/posix/Mutex.h +++ b/cpp/src/qpid/sys/posix/Mutex.h @@ -43,7 +43,7 @@ public: inline ~Mutex(); inline void lock(); inline void unlock(); - inline void trylock(); + inline bool trylock(); protected: @@ -127,7 +127,7 @@ struct PODMutex inline void lock(); inline void unlock(); - inline void trylock(); + inline bool trylock(); // Must be public to be a POD: pthread_mutex_t mutex; @@ -143,8 +143,8 @@ void PODMutex::unlock() { QPID_POSIX_THROW_IF(pthread_mutex_unlock(&mutex)); } -void PODMutex::trylock() { - QPID_POSIX_THROW_IF(pthread_mutex_trylock(&mutex)); +bool PODMutex::trylock() { + return pthread_mutex_trylock(&mutex) == 0; } Mutex::Mutex() { @@ -163,8 +163,8 @@ void Mutex::unlock() { QPID_POSIX_THROW_IF(pthread_mutex_unlock(&mutex)); } -void Mutex::trylock() { - QPID_POSIX_THROW_IF(pthread_mutex_trylock(&mutex)); +bool Mutex::trylock() { + return pthread_mutex_trylock(&mutex) == 0; } |
