wwbmmm commented on code in PR #3096:
URL: https://github.com/apache/brpc/pull/3096#discussion_r2434784424


##########
src/bthread/task_control.cpp:
##########
@@ -587,4 +587,29 @@ bvar::LatencyRecorder* 
TaskControl::create_exposed_pending_time() {
     return pt;
 }
 
+std::vector<bthread_t> TaskControl::get_living_bthreads() {
+    std::vector<bthread_t> living_bthread_ids;
+    std::vector<TaskMeta*> living_tasks = butil::list_resources<TaskMeta>(

Review Comment:
   Since `butil::list_resources` accepts a lambda function, I think it don't 
need to return vector<TaskMeta*> any more. you can capture the local variable 
`living_bthread_ids`  by reference and directly use 
living_bthread_ids.push_back(m->tid) in the lambda function.



-- 
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]

Reply via email to