diff --git a/BUILD.gn b/BUILD.gn index d4564cd..6455e11 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -350,15 +350,13 @@ if (defined(ohos_lite)) { } ohos_shared_library("uv") { deps = [ ":libuv_source" ] - if (is_ohos) { - external_deps = [ "hilog:libhilog" ] - } public_configs = [ ":libuv_config" ] subsystem_name = "thirdparty" innerapi_tags = [ "platformsdk" ] part_name = "libuv" if (is_ohos) { output_extension = "so" + external_deps = [ "hilog:libhilog" ] } install_images = [ "system", diff --git a/src/threadpool.c b/src/threadpool.c index edd724f..07e0440 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -770,13 +770,8 @@ void uv__ffrt_work(ffrt_executor_task_t* data, ffrt_qos_t qos) #ifdef UV_STATISTIC uv__post_statistic_work(w, WORK_END); #endif - uv__loop_internal_fields_t* lfields = uv__get_internal_fields(loop); rdlock_closed_uv_loop_rwlock(); - if (loop->magic != UV_LOOP_MAGIC - || !lfields - || qos >= ARRAY_SIZE(lfields->wq_sub) - || !lfields->wq_sub[qos].next - || !lfields->wq_sub[qos].prev) { + if (loop->magic != UV_LOOP_MAGIC) { rdunlock_closed_uv_loop_rwlock(); UV_LOGE("uv_loop(%{public}zu:%{public}#x) in task(%p:%p) is invalid", (size_t)loop, loop->magic, req->work_cb, req->after_work_cb); @@ -792,6 +787,7 @@ void uv__ffrt_work(ffrt_executor_task_t* data, ffrt_qos_t qos) (UV_EVENT_MAGIC_OFFSET << UV_EVENT_MAGIC_OFFSETBITS)); addr->post_task_func(addr->event_handler, uv__task_done_wrapper, (void*)w, status, qos); } else { + uv__loop_internal_fields_t* lfields = uv__get_internal_fields(loop); uv__queue_insert_tail(&(lfields->wq_sub[qos]), &w->wq); uv_async_send(&loop->wq_async); }