From ed1f486e2c2d8c02d675363d848a3460edfe80e3 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期二, 29 十二月 2020 16:22:34 +0800 Subject: [PATCH] update --- test_net_socket/test_net_mod_socket.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test_net_socket/test_net_mod_socket.c b/test_net_socket/test_net_mod_socket.c index 5693cf6..c5092e9 100644 --- a/test_net_socket/test_net_mod_socket.c +++ b/test_net_socket/test_net_mod_socket.c @@ -85,7 +85,7 @@ void *bus_handler(void *sockt) { - pthread_detach(pthread_self()); + // pthread_detach(pthread_self()); char action[512]; while ( true) { @@ -119,6 +119,10 @@ printf("start bus failed\n"); exit(1); } + + if (pthread_join(tid, NULL) != 0) { + perror(" pthread_join"); + } } @@ -137,7 +141,6 @@ sprintf(sendbuf, "RECEIVED PORT %d NAME %s", remote_port, recvbuf); net_mod_socket_sendto(client, sendbuf, strlen(sendbuf) + 1, remote_port); free(recvbuf); - sleep(1000); } } @@ -282,7 +285,7 @@ void test_net_sendandrecv_threads(char *nodelist) { - int status, i = 0, processors = 4; + int status, i = 0, processors = 1; void *res[processors]; // Targ *targs = (Targ *)calloc(processors, sizeof(Targ)); Targ targs[processors]; -- Gitblit v1.8.0