From 8d2daa5c972e55edd37b87fbcf6abda02c36f3c1 Mon Sep 17 00:00:00 2001 From: yongyuan Date: Thu, 6 Jun 2024 22:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=B4=A9=E6=BA=83=E5=9C=A8uv?= =?UTF-8?q?=5F=5Fasync=5Fsend=E4=B8=AD=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yongyuan --- src/threadpool.c | 6 ------ src/unix/async.c | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index 2cb0d95..875556e 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -37,7 +37,6 @@ #include #define MAX_THREADPOOL_SIZE 1024 -#define TASK_NUMBER_WARNING 1000 #define UV_TRACE_NAME "UV_TRACE" static uv_rwlock_t g_closed_uv_loop_rwlock; @@ -665,11 +664,6 @@ void uv__work_done(uv_async_t* handle) { QUEUE_APPEND(&lfields->wq_sub[i], &wq); } } - - if (loop->active_reqs.count > TASK_NUMBER_WARNING - && uv_check_data_valid((struct uv_loop_data*)(loop->data)) != 0) { - UV_LOGW("The number of task is too much, task number is %{public}u", loop->active_reqs.count); - } #endif uv_mutex_unlock(&loop->wq_mutex); diff --git a/src/unix/async.c b/src/unix/async.c index 32e3e53..91baec6 100644 --- a/src/unix/async.c +++ b/src/unix/async.c @@ -141,6 +141,11 @@ static void uv__async_send(uv_async_t* handle) { int r; uv_loop_t* loop = handle->loop; + if (loop == NULL) { + UV_LOGE("fatal error! loop is NULL"); + return; + } + buf = ""; len = 1; fd = loop->async_wfd; -- Gitee