| 307 | } |
| 308 | |
| 309 | void Stream::TriggerOnConnectIfNeed() { |
| 310 | if (_connect_meta.on_connect != NULL) { |
| 311 | ConnectMeta* meta = new ConnectMeta; |
| 312 | meta->on_connect = _connect_meta.on_connect; |
| 313 | meta->arg = _connect_meta.arg; |
| 314 | meta->ec = _connect_meta.ec; |
| 315 | bthread_mutex_unlock(&_connect_mutex); |
| 316 | bthread_t tid; |
| 317 | if (bthread_start_urgent(&tid, &BTHREAD_ATTR_NORMAL, RunOnConnect, meta) != 0) { |
| 318 | LOG(FATAL) << "Fail to start bthread, " << berror(); |
| 319 | RunOnConnect(meta); |
| 320 | } |
| 321 | return; |
| 322 | } |
| 323 | bthread_mutex_unlock(&_connect_mutex); |
| 324 | } |
| 325 | |
| 326 | int Stream::AppendIfNotFull(const butil::IOBuf &data, |
| 327 | const StreamWriteOptions* options) { |
nothing calls this directly
no test coverage detected