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

Method put_front

lib_acl_cpp/src/connpool/connect_pool.cpp:614–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614void connect_pool::put_front(connect_client* conn)
615{
616 //time_t now = time(NULL);
617
618 lock_.lock();
619
620 // ����Ƿ������������ٱ�־λ
621 if (delay_destroy_) {
622 if (conn->get_pool() == this) {
623 count_dec(false);
624 }
625 delete conn;
626
627 if (refers_ <= 0) {
628 // ������ü���Ϊ 0 ��������
629 lock_.unlock();
630 delete this;
631 } else {
632 lock_.unlock();
633 }
634 return;
635 }
636
637 alive_ = true; // �����ӳ䵱������ɹ����ܣ����Կ��ڴ˴����÷������
638
639 // ��ֹ���¹���ʱ�䣬�Է�ֹ��Զ�޷������ͷ�!
640 //conn->set_when(now);
641
642 // ���黹�����ӷ��������ײ��������ڵ����ͷŹ�������
643 // ʱ�ȽϷ��㣬�����ھ��콫��æ�����ݿ����ӹر�
644 pool_.push_front(conn);
645
646 lock_.unlock();
647}
648
649void connect_pool::keep_conns(thread_pool* threads /* NULL */)
650{

Callers

nothing calls this directly

Calls 3

push_frontMethod · 0.80
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected