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

Method Clear

src/brpc/selective_channel.cpp:418–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418void Sender::Clear() {
419 if (_main_cntl == NULL) {
420 return;
421 }
422 for (int i = 0; i < _nalloc; ++i) {
423 delete _alloc_resources[i].response;
424 if (_alloc_resources[i].sub_done != &_sub_done0) {
425 delete _alloc_resources[i].sub_done;
426 }
427 _alloc_resources[i] = Resource();
428 }
429 const CallId cid = _main_cntl->call_id();
430 _main_cntl = NULL;
431 if (_user_done) {
432 _user_done->Run();
433 }
434 bthread_id_unlock_and_destroy(cid);
435}
436
437inline Resource Sender::PopFree() {
438 if (_nfree == 0) {

Callers 1

PopFreeMethod · 0.45

Calls 4

ResourceClass · 0.85
call_idMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected