diff --git a/src/libipc/platform/posix/condition.h b/src/libipc/platform/posix/condition.h index ea66a96..77ff56f 100644 --- a/src/libipc/platform/posix/condition.h +++ b/src/libipc/platform/posix/condition.h @@ -92,6 +92,7 @@ public: } void clear() noexcept { + LIBIPC_LOG(); if ((shm_.ref() <= 1) && cond_ != nullptr) { int eno; if ((eno = ::pthread_cond_destroy(cond_)) != 0) { @@ -134,6 +135,7 @@ public: } bool notify(ipc::sync::mutex &) noexcept { + LIBIPC_LOG(); if (!valid()) return false; int eno; if ((eno = ::pthread_cond_signal(cond_)) != 0) { @@ -144,6 +146,7 @@ public: } bool broadcast(ipc::sync::mutex &) noexcept { + LIBIPC_LOG(); if (!valid()) return false; int eno; if ((eno = ::pthread_cond_broadcast(cond_)) != 0) { diff --git a/src/libipc/platform/posix/mutex.h b/src/libipc/platform/posix/mutex.h index 16f2647..a4c5e9f 100644 --- a/src/libipc/platform/posix/mutex.h +++ b/src/libipc/platform/posix/mutex.h @@ -113,6 +113,7 @@ public: } bool open(char const *name) noexcept { + LIBIPC_LOG(); close(); if ((mutex_ = acquire_mutex(name)) == nullptr) { return false; @@ -152,7 +153,7 @@ public: LIBIPC_LOG(); if ((ref_ != nullptr) && (shm_ != nullptr) && (mutex_ != nullptr)) { if (shm_->name() != nullptr) { - release_mutex(shm_->name(), [this] { + release_mutex(shm_->name(), [this, &log] { auto self_ref = ref_->fetch_sub(1, std::memory_order_relaxed); if ((shm_->ref() <= 1) && (self_ref <= 1)) { // Before destroying the mutex, try to unlock it. @@ -183,7 +184,7 @@ public: LIBIPC_LOG(); if ((shm_ != nullptr) && (mutex_ != nullptr)) { if (shm_->name() != nullptr) { - release_mutex(shm_->name(), [this] { + release_mutex(shm_->name(), [this, &log] { // Unlock before destroying, same reasoning as in close() ::pthread_mutex_unlock(mutex_); @@ -240,6 +241,7 @@ public: } bool try_lock() noexcept(false) { + LIBIPC_LOG(); if (!valid()) return false; auto ts = posix_::detail::make_timespec(0); int eno = ::pthread_mutex_timedlock(mutex_, &ts);