From 3283fb54dd25d3a9ccee195ae367cb07f69364a7 Mon Sep 17 00:00:00 2001 From: wangyunfang93 Date: Mon, 20 Feb 2023 11:05:55 +0000 Subject: [PATCH] test Signed-off-by: wangyunfang93 --- src/threadpool.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index e804c7c..dd17f90 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -26,6 +26,10 @@ #endif #include +#include +#include +#include +#include #define MAX_THREADPOOL_SIZE 1024 @@ -251,8 +255,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