MCPcopy Create free account
hub / github.com/apache/brpc / NotifyOnFailed

Method NotifyOnFailed

src/brpc/socket.cpp:1121–1135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1119}
1120
1121void Socket::NotifyOnFailed(bthread_id_t id) {
1122 pthread_mutex_lock(&_id_wait_list_mutex);
1123 if (!Failed()) {
1124 const int rc = bthread_id_list_add(&_id_wait_list, id);
1125 pthread_mutex_unlock(&_id_wait_list_mutex);
1126 if (rc != 0) {
1127 bthread_id_error(id, rc);
1128 }
1129 } else {
1130 const int rc = non_zero_error_code();
1131 const std::string desc = _error_text;
1132 pthread_mutex_unlock(&_id_wait_list_mutex);
1133 bthread_id_error2(id, rc, desc);
1134 }
1135}
1136
1137// For unit-test.
1138int Socket::Status(SocketId id, int32_t* nref) {

Callers 4

NotifyOnCancelMethod · 0.80
NotifyOnStoppedMethod · 0.80
DestroyStreamCreatorMethod · 0.80
OnCreateStreamMethod · 0.80

Calls 4

pthread_mutex_lockFunction · 0.85
bthread_id_list_addFunction · 0.85
pthread_mutex_unlockFunction · 0.85
non_zero_error_codeFunction · 0.85

Tested by

no test coverage detected