From 653f014233e22113f3b3dc18299991fe207c6834 Mon Sep 17 00:00:00 2001 From: wangyunfang93 Date: Mon, 20 Feb 2023 11:56:50 +0000 Subject: [PATCH] test2 Signed-off-by: wangyunfang93 --- src/threadpool.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index e804c7c..508f188 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -26,6 +26,11 @@ #endif #include +#include +#include +#include +#include + #define MAX_THREADPOOL_SIZE 1024 @@ -251,8 +256,18 @@ static void init_once(void) { * Note that this discards the global mutex and condition as well * as the work queue. */ - if (pthread_atfork(NULL, NULL, &reset_once)) - abort(); + static int xx=0; + xx++; + if (pthread_atfork(NULL, NULL, &reset_once)) { + FILE *fp=fopen("/dev/asan/libuv.log","a"); + if(fp){ + sprintf(fp,"%d:%d wyf xx=%d errno=%d\n",getpid(),gettid(),xx,errno); + fclose(fp); + abort(); + } else{ + while(1); + } + } #endif init_threads(); } -- Gitee