@@ -113,6 +113,7 @@ class mutex {
113113 }
114114
115115 bool open (char const *name) noexcept {
116+ LIBIPC_LOG ();
116117 close ();
117118 if ((mutex_ = acquire_mutex (name)) == nullptr ) {
118119 return false ;
@@ -152,7 +153,7 @@ class mutex {
152153 LIBIPC_LOG ();
153154 if ((ref_ != nullptr ) && (shm_ != nullptr ) && (mutex_ != nullptr )) {
154155 if (shm_->name () != nullptr ) {
155- release_mutex (shm_->name (), [this ] {
156+ release_mutex (shm_->name (), [this , &log ] {
156157 auto self_ref = ref_->fetch_sub (1 , std::memory_order_relaxed);
157158 if ((shm_->ref () <= 1 ) && (self_ref <= 1 )) {
158159 // Before destroying the mutex, try to unlock it.
@@ -183,7 +184,7 @@ class mutex {
183184 LIBIPC_LOG ();
184185 if ((shm_ != nullptr ) && (mutex_ != nullptr )) {
185186 if (shm_->name () != nullptr ) {
186- release_mutex (shm_->name (), [this ] {
187+ release_mutex (shm_->name (), [this , &log ] {
187188 // Unlock before destroying, same reasoning as in close()
188189 ::pthread_mutex_unlock (mutex_);
189190
@@ -240,6 +241,7 @@ class mutex {
240241 }
241242
242243 bool try_lock () noexcept (false ) {
244+ LIBIPC_LOG ();
243245 if (!valid ()) return false ;
244246 auto ts = posix_::detail::make_timespec (0 );
245247 int eno = ::pthread_mutex_timedlock (mutex_, &ts);
0 commit comments