| 239 | } |
| 240 | |
| 241 | void ProgressiveAttachment::NotifyOnStopped(google::protobuf::Closure* done) { |
| 242 | if (done == NULL) { |
| 243 | LOG(ERROR) << "Param[done] is NULL"; |
| 244 | return; |
| 245 | } |
| 246 | if (_notify_id != INVALID_BTHREAD_ID) { |
| 247 | LOG(ERROR) << "NotifyOnStopped() can only be called once"; |
| 248 | return done->Run(); |
| 249 | } |
| 250 | if (_httpsock == NULL) { |
| 251 | return done->Run(); |
| 252 | } |
| 253 | const int rc = bthread_id_create(&_notify_id, done, RunOnFailed); |
| 254 | if (rc) { |
| 255 | LOG(ERROR) << "Fail to create _notify_id: " << berror(rc); |
| 256 | return done->Run(); |
| 257 | } |
| 258 | _httpsock->NotifyOnFailed(_notify_id); |
| 259 | } |
| 260 | |
| 261 | } // namespace brpc |
nothing calls this directly
no test coverage detected