| 1119 | } |
| 1120 | |
| 1121 | void 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. |
| 1138 | int Socket::Status(SocketId id, int32_t* nref) { |
no test coverage detected