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: [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]