lorinlee commented on a change in pull request #1326:
URL: https://github.com/apache/incubator-brpc/pull/1326#discussion_r554896894



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

Reply via email to