gydong commented on a change in pull request #1326:
URL: https://github.com/apache/incubator-brpc/pull/1326#discussion_r554802130
##########
File path: src/bthread/butex.cpp
##########
@@ -241,10 +241,8 @@ inline int unsleep_if_necessary(ButexBthreadWaiter* w,
void* butex_create() {
Butex* b = butil::get_object<Butex>();
- if (b) {
- return &b->value;
- }
- return NULL;
+ CHECK(b != nullptr) << "cannot allocate butex";
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]