wwbmmm commented on issue #3069:
URL: https://github.com/apache/brpc/issues/3069#issuecomment-3394003859

   
按照目前的接口设计,似乎不太好实现线程安全的clear_stats,因为clear_stats时需要delete子bvar对象。而当你get_stats时,返回的是子bvar对象的指针(如bvar::LatencyRecorder*),那么这里就存在使用了被delete的指针的问题。
   如果要实现线程安全就必须跟踪子bvar的被引用状态,那么get_stats就应该返回一个类似智能指针的东西。


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