diff options
author | Gordon Sim <gsim@apache.org> | 2009-06-17 19:00:58 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-06-17 19:00:58 +0000 |
commit | 53c256d0c4e36d83ab819f4d5c1abf881321ffd8 (patch) | |
tree | 81c43560f66e615513ea9c0cef791ef0b8944545 | |
parent | 9e3b98bffa42574cf09682e50867b72a8b365b5b (diff) | |
download | qpid-python-53c256d0c4e36d83ab819f4d5c1abf881321ffd8.tar.gz |
Don't throw exception from destructor in Mutex and Condition as this is unsafe and unhelpful.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@785757 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/sys/posix/Condition.h | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/sys/posix/Mutex.h | 4 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/sys/posix/check.h | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/sys/posix/Condition.h b/qpid/cpp/src/qpid/sys/posix/Condition.h index 86d6500ee9..62e42c01e9 100644 --- a/qpid/cpp/src/qpid/sys/posix/Condition.h +++ b/qpid/cpp/src/qpid/sys/posix/Condition.h @@ -56,7 +56,7 @@ Condition::Condition() { } Condition::~Condition() { - QPID_POSIX_ASSERT_THROW_IF(pthread_cond_destroy(&condition)); + QPID_POSIX_ABORT_IF(pthread_cond_destroy(&condition)); } void Condition::wait(Mutex& mutex) { diff --git a/qpid/cpp/src/qpid/sys/posix/Mutex.h b/qpid/cpp/src/qpid/sys/posix/Mutex.h index cd5a8affd4..564cb72c56 100644 --- a/qpid/cpp/src/qpid/sys/posix/Mutex.h +++ b/qpid/cpp/src/qpid/sys/posix/Mutex.h @@ -109,7 +109,7 @@ Mutex::Mutex() { } Mutex::~Mutex(){ - QPID_POSIX_ASSERT_THROW_IF(pthread_mutex_destroy(&mutex)); + QPID_POSIX_ABORT_IF(pthread_mutex_destroy(&mutex)); } void Mutex::lock() { @@ -130,7 +130,7 @@ RWlock::RWlock() { } RWlock::~RWlock(){ - QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_destroy(&rwlock)); + QPID_POSIX_ABORT_IF(pthread_rwlock_destroy(&rwlock)); } void RWlock::wlock() { diff --git a/qpid/cpp/src/qpid/sys/posix/check.h b/qpid/cpp/src/qpid/sys/posix/check.h index f3031b7593..5f18b26cec 100644 --- a/qpid/cpp/src/qpid/sys/posix/check.h +++ b/qpid/cpp/src/qpid/sys/posix/check.h @@ -46,4 +46,6 @@ do { int e=(ERRNO); if (e) { errno=e; ::perror(0); assert(0); } } while(0) #endif +#define QPID_POSIX_ABORT_IF(ERRNO) if ((int) ERRNO) { errno=ERRNO; ::perror(0); abort(); } + #endif /*!_posix_check_h*/ |