��ʼ������
| 30 | |
| 31 | // ��ʼ������ |
| 32 | static void init(const char* addrs, int max, int min, int ttl, |
| 33 | int check_type, const char* proto) |
| 34 | { |
| 35 | // ���� HTTP �������ӳؼ�Ⱥ�������� |
| 36 | __conn_manager = new connect_manager((size_t) min); |
| 37 | |
| 38 | // ���ӷ�������Ⱥ��ַ |
| 39 | __conn_manager->init(addrs, addrs, (size_t) max); |
| 40 | __conn_manager->set_idle_ttl(ttl); |
| 41 | |
| 42 | printf(">>>start monitor thread\r\n"); |
| 43 | |
| 44 | // ������̨����߳� |
| 45 | int check_inter = 1, conn_timeout = 5; |
| 46 | |
| 47 | acl::connect_monitor* monitor = new mymonitor(*__conn_manager, proto, |
| 48 | check_type != 0); |
| 49 | monitor->set_check_inter(check_inter); |
| 50 | monitor->set_conn_timeout(conn_timeout); |
| 51 | monitor->set_check_conns(true, true, true, __threads); |
| 52 | |
| 53 | if (check_type == 2) { |
| 54 | monitor->open_rpc_service(10, NULL); |
| 55 | } |
| 56 | |
| 57 | (void) __conn_manager->start_monitor(monitor); |
| 58 | |
| 59 | printf(">>>create thread pool\r\n"); |
| 60 | // �����̳߳� |
| 61 | __thr_pool = acl_thread_pool_create(max, 60); |
| 62 | } |
| 63 | |
| 64 | // �����˳�ǰ������Դ |
| 65 | static void end(void) |
no test coverage detected
searching dependent graphs…