You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/01/24 13:57:18 UTC

[GitHub] [incubator-brpc] JimChengLin commented on a change in pull request #1669: Fix C++ compile issue and clang compile issue

JimChengLin commented on a change in pull request #1669:
URL: https://github.com/apache/incubator-brpc/pull/1669#discussion_r790766992



##########
File path: src/bthread/mutex.h
##########
@@ -48,15 +48,15 @@ class Mutex {
     Mutex() {
         int ec = bthread_mutex_init(&_mutex, NULL);
         if (ec != 0) {
-            throw std::system_error(std::error_code(ec, std::system_category()), "Mutex constructor failed");
+            CHECK(false) << "Mutex constructor failed";
         }
     }
     ~Mutex() { CHECK_EQ(0, bthread_mutex_destroy(&_mutex)); }
     native_handler_type native_handler() { return &_mutex; }
     void lock() {
         int ec = bthread_mutex_lock(&_mutex);
         if (ec != 0) {
-            throw std::system_error(std::error_code(ec, std::system_category()), "Mutex lock failed");

Review comment:
       @x2c3z4 Google Style is good but I guess there is no way to ensure no one else is using this behavior. Removing the exception may break others codebase.




-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org