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

Function ping_main_threads

lib_protocol/samples/ping/main.c:170–189  ·  view source on GitHub ↗

���̷߳�ʽ PING ���Ŀ���ַ��ÿ���̲߳���ͬ�� PING ��ʽ */

Source from the content-addressed store, hash-verified

168
169/* ���̷߳�ʽ PING ���Ŀ���ַ��ÿ���̲߳���ͬ�� PING ��ʽ */
170static void ping_main_threads(const ACL_ARGV *ip_list, int npkt)
171{
172 int i, n;
173 acl_pthread_t tids[128];
174 acl_pthread_attr_t attr;
175
176 __npkt = npkt;
177 acl_pthread_attr_init(&attr);
178 acl_pthread_attr_setdetachstate(&attr, 0);
179
180 /* �޶�ÿ�������߳�������ֹϵͳ����̫�� */
181 n = ip_list->argc > 128 ? 128 : ip_list->argc;
182 for (i = 0; i < n; i++)
183 /* ���� PING �߳� */
184 acl_pthread_create(&tids[i], &attr, ping_thread, ip_list->argv[i]);
185
186 for (i = 0; i < n; i++)
187 /* �����߳�״̬ */
188 acl_pthread_join(tids[i], NULL);
189}
190
191static void usage(const char* progname)
192{

Callers 1

mainFunction · 0.85

Calls 4

acl_pthread_attr_initFunction · 0.85
acl_pthread_createFunction · 0.85
acl_pthread_joinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…