MCPcopy Create free account
hub / github.com/acl-dev/acl / aliving

Method aliving

lib_acl_cpp/src/connpool/connect_pool.cpp:173–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173bool connect_pool::aliving()
174{
175 // XXX����Ȼ�˴�δ��������ҲӦ�ò��������⣬��Ϊ����� peek() ���̻��ٴ�
176 // �� alive_ �������Է�ֹ���̲߳���ʱ�ij�ͻ
177 if (alive_) {
178 return true;
179 }
180
181 time_t now = time(NULL);
182
183 lock_.lock();
184 if (retry_inter_ > 0 && now - last_dead_ >= retry_inter_) {
185 alive_ = true;
186 lock_.unlock();
187
188 // ���÷��������״̬���Ա�����
189 logger("reset server: %s", get_addr());
190 return true;
191 }
192
193 lock_.unlock();
194 return false;
195}
196
197connect_client* connect_pool::peek(bool on, double* tc, bool* old)
198{

Callers 7

endFunction · 0.45
check_all_connectionsFunction · 0.45
check_all_connectionsFunction · 0.45
getMethod · 0.45
peekMethod · 0.45
check_deadMethod · 0.45
keep_connsMethod · 0.45

Calls 3

get_addrFunction · 0.50
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected