From a9bf54c9149148cf999d48f76d22096d6e5bc839 Mon Sep 17 00:00:00 2001 From: robotsl Date: Wed, 19 Jun 2024 10:33:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0uv=5F=5Fwork*=E5=88=A4?= =?UTF-8?q?=E7=A9=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: robotsl --- src/threadpool.c | 6 +++++- src/unix/ohos/log_ohos.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index 2cb0d95..ef727d1 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -716,7 +716,11 @@ static void uv__queue_work(struct uv__work* w) { static void uv__queue_done(struct uv__work* w, int err) { uv_work_t* req; - + if (w == NULL) + { + UV_LOGE("uv__work* w is NULL\n"); + return; + } req = container_of(w, uv_work_t, work_req); uv__req_unregister(req->loop, req); diff --git a/src/unix/ohos/log_ohos.c b/src/unix/ohos/log_ohos.c index 6c6872e..2684261 100644 --- a/src/unix/ohos/log_ohos.c +++ b/src/unix/ohos/log_ohos.c @@ -47,7 +47,7 @@ LogLevel convert_uv_log_level(enum uv__log_level level) { int uv__log_impl(enum uv__log_level level, const char *fmt, ...) { va_list args; va_start(args, fmt); - int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD003900, "UV", fmt, args); + int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD00394F, "UV", fmt, args); va_end(args); return ret; } -- Gitee From 276cc4dea982b7304e95e50c9d0bbe08956762aa Mon Sep 17 00:00:00 2001 From: robotsl Date: Wed, 19 Jun 2024 10:33:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0uv=5F=5Fwork*=E5=88=A4?= =?UTF-8?q?=E7=A9=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: robotsl --- src/threadpool.c | 5 ++++- src/unix/ohos/log_ohos.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index 2cb0d95..baea275 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -716,7 +716,10 @@ static void uv__queue_work(struct uv__work* w) { static void uv__queue_done(struct uv__work* w, int err) { uv_work_t* req; - + if (w == NULL){ + UV_LOGE("uv__work* w is NULL, returned and unable to call after_work_cb."); + return; + } req = container_of(w, uv_work_t, work_req); uv__req_unregister(req->loop, req); diff --git a/src/unix/ohos/log_ohos.c b/src/unix/ohos/log_ohos.c index 6c6872e..2684261 100644 --- a/src/unix/ohos/log_ohos.c +++ b/src/unix/ohos/log_ohos.c @@ -47,7 +47,7 @@ LogLevel convert_uv_log_level(enum uv__log_level level) { int uv__log_impl(enum uv__log_level level, const char *fmt, ...) { va_list args; va_start(args, fmt); - int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD003900, "UV", fmt, args); + int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD00394F, "UV", fmt, args); va_end(args); return ret; } -- Gitee From 611b1226cf33a415ba35f2180caee074d75135b2 Mon Sep 17 00:00:00 2001 From: robotsl Date: Thu, 20 Jun 2024 15:54:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9log=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: robotsl --- src/threadpool.c | 3 ++- src/unix/ohos/log_ohos.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index baea275..fb24c41 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -716,8 +716,9 @@ static void uv__queue_work(struct uv__work* w) { static void uv__queue_done(struct uv__work* w, int err) { uv_work_t* req; + if (w == NULL){ - UV_LOGE("uv__work* w is NULL, returned and unable to call after_work_cb."); + UV_LOGE("uv_work_t is NULL"); return; } req = container_of(w, uv_work_t, work_req); diff --git a/src/unix/ohos/log_ohos.c b/src/unix/ohos/log_ohos.c index 2684261..6c6872e 100644 --- a/src/unix/ohos/log_ohos.c +++ b/src/unix/ohos/log_ohos.c @@ -47,7 +47,7 @@ LogLevel convert_uv_log_level(enum uv__log_level level) { int uv__log_impl(enum uv__log_level level, const char *fmt, ...) { va_list args; va_start(args, fmt); - int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD00394F, "UV", fmt, args); + int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD003900, "UV", fmt, args); va_end(args); return ret; } -- Gitee From ba045a95cf16affbaf0eb9f9124da7388616c3ad Mon Sep 17 00:00:00 2001 From: robotsl Date: Thu, 20 Jun 2024 15:54:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9log=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liaoxingxing --- src/threadpool.c | 4 +++- src/unix/ohos/log_ohos.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index baea275..a23e110 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -716,10 +716,12 @@ static void uv__queue_work(struct uv__work* w) { static void uv__queue_done(struct uv__work* w, int err) { uv_work_t* req; + if (w == NULL){ - UV_LOGE("uv__work* w is NULL, returned and unable to call after_work_cb."); + UV_LOGE("uv_work_t is NULL"); return; } + req = container_of(w, uv_work_t, work_req); uv__req_unregister(req->loop, req); diff --git a/src/unix/ohos/log_ohos.c b/src/unix/ohos/log_ohos.c index 2684261..6c6872e 100644 --- a/src/unix/ohos/log_ohos.c +++ b/src/unix/ohos/log_ohos.c @@ -47,7 +47,7 @@ LogLevel convert_uv_log_level(enum uv__log_level level) { int uv__log_impl(enum uv__log_level level, const char *fmt, ...) { va_list args; va_start(args, fmt); - int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD00394F, "UV", fmt, args); + int ret = HiLogPrintArgs(LOG_CORE, convert_uv_log_level(level), 0xD003900, "UV", fmt, args); va_end(args); return ret; } -- Gitee