This is an automated email from the ASF dual-hosted git repository.

wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a02745e Fix unused private field warning of FastPthreadMutex (#2839)
1a02745e is described below

commit 1a02745e45ca519c8da668882b87b766f53e3150
Author: Bright Chen <chenguangmin...@foxmail.com>
AuthorDate: Tue Dec 10 15:30:04 2024 +0800

    Fix unused private field warning of FastPthreadMutex (#2839)
---
 src/bthread/mutex.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bthread/mutex.cpp b/src/bthread/mutex.cpp
index bd705806..fb064703 100644
--- a/src/bthread/mutex.cpp
+++ b/src/bthread/mutex.cpp
@@ -660,7 +660,7 @@ void submit_contention(const bthread_contention_site_t& 
csite, int64_t now_ns) {
 }
 
 #if BRPC_DEBUG_LOCK
-#define MUTEX_RESET_OWNER_COMMON(owner)                                        
             \
+#define MUTEX_RESET_OWNER_COMMON(owner)                                        
      \
     ((butil::atomic<bool>*)&(owner).hold)                                      
      \
         ->store(false, butil::memory_order_relaxed)
 
@@ -680,9 +680,9 @@ void submit_contention(const bthread_contention_site_t& 
csite, int64_t now_ns) {
                    << std::endl << trace.ToString();                           
      \
     }
 #else
-#define MUTEX_RESET_OWNER_COMMON(owner) ((void)0)
-#define PTHREAD_MUTEX_SET_OWNER(owner) ((void)0)
-#define PTHREAD_MUTEX_CHECK_OWNER(owner) ((void)0)
+#define MUTEX_RESET_OWNER_COMMON(owner) ((void)owner)
+#define PTHREAD_MUTEX_SET_OWNER(owner) ((void)owner)
+#define PTHREAD_MUTEX_CHECK_OWNER(owner) ((void)owner)
 #endif // BRPC_DEBUG_LOCK
 
 namespace internal {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to