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


##########
src/bthread/task_meta.h:
##########
@@ -43,10 +48,10 @@ struct ButexWaiter;
 struct LocalStorage {
     KeyTable* keytable;
     void* assigned_data;
-    void* rpcz_parent_span;
+    std::weak_ptr<brpc::Span> rpcz_parent_span;

Review Comment:
   I think you 'd better not use brpc types in the bthread code.
   In the brpc design, bthread is a basic library, and brpc is built on top of 
it. So bthread should no depend on brpc. This is why the original type is 
`void*`, not `brpc::Span*`.
   My suggestion: you can keep `void* rpcz_parent_span` here, and in the brpc 
code, you can new a `std::weak_ptr<brpc::Span>`, then cast the pointer 
`std::weak_ptr<brpc::Span>*` to `void*`. This may be more complicated, but keep 
the brpc design clean.



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