chenBright commented on code in PR #2207:
URL: https://github.com/apache/brpc/pull/2207#discussion_r1168312352
##########
test/brpc_load_balancer_unittest.cpp:
##########
@@ -1101,4 +1101,113 @@ TEST_F(LoadBalancerTest, la_selection_too_long) {
ASSERT_EQ(EHOSTDOWN, lb.SelectServer(in, &out));
}
+bool g_started = false;
+bool g_stopped = false;
+int g_prof_name_counter = 0;
+
+using PerfMap = std::unordered_map<int, int>;
+
+bool AddMapN(PerfMap& f, int n) {
+ ++f[n];
+ return true;
+}
+
+template<typename DBD>
+struct BAIDU_CACHELINE_ALIGNMENT PerfArgs {
+ DBD* dbd;
+ int64_t counter;
+ int64_t elapse_ns;
+ bool ready;
+
+ PerfArgs() : dbd(NULL), counter(0), elapse_ns(0), ready(false) {}
+};
+
+template<typename DBD>
+void* read_dbd(void* void_arg) {
+ auto args = (PerfArgs<DBD>*)void_arg;
+ args->ready = true;
+ pthread_mutex_t mutex;
Review Comment:
删漏了,当时为了测试了每个pthread线程一个独立的pthread_mutex的case。
##########
test/brpc_load_balancer_unittest.cpp:
##########
@@ -1101,4 +1101,113 @@ TEST_F(LoadBalancerTest, la_selection_too_long) {
ASSERT_EQ(EHOSTDOWN, lb.SelectServer(in, &out));
}
+bool g_started = false;
+bool g_stopped = false;
+int g_prof_name_counter = 0;
+
+using PerfMap = std::unordered_map<int, int>;
+
+bool AddMapN(PerfMap& f, int n) {
+ ++f[n];
+ return true;
+}
+
+template<typename DBD>
+struct BAIDU_CACHELINE_ALIGNMENT PerfArgs {
+ DBD* dbd;
+ int64_t counter;
+ int64_t elapse_ns;
+ bool ready;
+
+ PerfArgs() : dbd(NULL), counter(0), elapse_ns(0), ready(false) {}
+};
+
+template<typename DBD>
+void* read_dbd(void* void_arg) {
+ auto args = (PerfArgs<DBD>*)void_arg;
+ args->ready = true;
+ pthread_mutex_t mutex;
Review Comment:
已删除
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]