summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-06-17 19:00:58 +0000
committerGordon Sim <gsim@apache.org>2009-06-17 19:00:58 +0000
commit00cefc5c8dc3eac268a39141254aea5e6f1ab8e7 (patch)
tree0b21789a88ea7f3e817ca5177986ec1a9517933f /cpp/src
parentebf5fd6fd3eb48bfb1015ad4f6a2aa57d4eb5668 (diff)
downloadqpid-python-00cefc5c8dc3eac268a39141254aea5e6f1ab8e7.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/qpid@785757 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/sys/posix/Condition.h2
-rw-r--r--cpp/src/qpid/sys/posix/Mutex.h4
-rw-r--r--cpp/src/qpid/sys/posix/check.h2
3 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/posix/Condition.h b/cpp/src/qpid/sys/posix/Condition.h
index 86d6500ee9..62e42c01e9 100644
--- a/cpp/src/qpid/sys/posix/Condition.h
+++ b/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/cpp/src/qpid/sys/posix/Mutex.h b/cpp/src/qpid/sys/posix/Mutex.h
index cd5a8affd4..564cb72c56 100644
--- a/cpp/src/qpid/sys/posix/Mutex.h
+++ b/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/cpp/src/qpid/sys/posix/check.h b/cpp/src/qpid/sys/posix/check.h
index f3031b7593..5f18b26cec 100644
--- a/cpp/src/qpid/sys/posix/check.h
+++ b/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*/