Skip to content

Commit

Permalink
[fix](thridparty) fix mutex problem of bvar
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Dec 27, 2023
1 parent d96278a commit 89d99fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions thirdparty/patches/brpc-bvar-mutex.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/src/bvar/variable.cpp b/src/bvar/variable.cpp
index 1f9da3a..f57aaa6 100644
--- a/src/bvar/variable.cpp
+++ b/src/bvar/variable.cpp
@@ -81,11 +81,7 @@ struct VarMapWithLock : public VarMap {

VarMapWithLock() {
CHECK_EQ(0, init(1024, 80));
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&mutex, &attr);
- pthread_mutexattr_destroy(&attr);
+ pthread_mutex_init(&mutex, NULL);
}
};

0 comments on commit 89d99fc

Please sign in to comment.