From 951b298329e23b8b8e0948bd522f35c36b64ea57 Mon Sep 17 00:00:00 2001 From: Conlain Kelly Date: Mon, 11 Jun 2018 15:13:46 -0400 Subject: Convert DataAccessor to use a shared_ptr to a lock --- src/components/utils/src/lock_posix.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/components/utils/src/lock_posix.cc') diff --git a/src/components/utils/src/lock_posix.cc b/src/components/utils/src/lock_posix.cc index 9b90ad20b9..b771a57726 100644 --- a/src/components/utils/src/lock_posix.cc +++ b/src/components/utils/src/lock_posix.cc @@ -37,6 +37,8 @@ #include #include #include "utils/logger.h" +#include +#include namespace sync_primitives { @@ -63,6 +65,8 @@ Lock::Lock(bool is_recursive) Lock::~Lock() { #ifndef NDEBUG if (lock_taken_ > 0) { + std::cerr << "LOCK DESTRUCT ERRROR!!!\n"; + exit(1); LOG4CXX_ERROR(logger_, "Destroying non-released mutex " << &mutex_); } #endif @@ -77,6 +81,8 @@ Lock::~Lock() { void Lock::Acquire() { const int32_t status = pthread_mutex_lock(&mutex_); if (status != 0) { + std::cerr << "LOCK ACQUIRE ERRROR!!!\n"; + exit(1); LOG4CXX_FATAL(logger_, "Failed to acquire mutex " << &mutex_ << ": " << strerror(status)); @@ -90,6 +96,8 @@ void Lock::Release() { AssertTakenAndMarkFree(); const int32_t status = pthread_mutex_unlock(&mutex_); if (status != 0) { + std::cerr << "LOCK RELEASE ERRROR!!!\n"; + exit(1); LOG4CXX_ERROR(logger_, "Failed to unlock mutex" << &mutex_ << ": " << strerror(status)); -- cgit v1.2.1