void Sender::Run() { _finished = true; if (_nfree != _nalloc) { const int saved_nalloc = _nalloc; int error = (_main_cntl->ErrorCode() == ERPCTIMEDOUT ? ERPCTIMEDOUT : ECANCELED); CallId ids[_nalloc]; for (int i = 0; i < _nalloc; ++i) { ids[i] = _alloc_resources[i].sub_done->_cntl.call_id(); } CallId cid = _main_cntl->call_id(); CHECK_EQ(0, bthread_id_unlock(cid)); for (int i = 0; i < saved_nalloc; ++i) { bthread_id_error(ids[i], error); } } else { Clear(); } }
void OnTimedOut(void *arg) { bthread_id_t id = { reinterpret_cast<uint64_t>(arg) }; bthread_id_error(id, ETIMEDOUT); }