diff --git a/BUILD.gn b/BUILD.gn index a90d15c706a23af4eee9cd7c7e85ac58bbb56528..180dd84bf0562eadf61199d609928b6d2570e896 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -187,7 +187,7 @@ if (defined(ohos_lite)) { # error in debug version, FIX ME # https://gitee.com/openharmony/build/pulls/1206/files defines = [ "NDEBUG" ] - if (use_ffrt && device_name != "sdk" && device_company != "qemu") { + if (use_ffrt) { defines += [ "USE_FFRT" ] } } else if (is_mingw || is_win) { @@ -292,7 +292,7 @@ if (defined(ohos_lite)) { "src/unix/random-sysctl-linux.c", "src/unix/proctitle.c", ] - if (use_ffrt && device_name != "sdk" && device_company != "qemu") { + if (use_ffrt) { external_deps = [ "ffrt:libffrt" ] } } else if (is_linux) { @@ -305,7 +305,7 @@ if (defined(ohos_lite)) { "src/unix/random-sysctl-linux.c", "src/unix/proctitle.c", ] - if (use_ffrt && device_name != "sdk" && device_company != "qemu") { + if (use_ffrt) { external_deps = [ "ffrt:libffrt" ] } } else { diff --git a/include/uv.h b/include/uv.h index 762aace02e54faeaa30b8b16c459a52ebea756c1..bd5976730990435509cd96a35d75f06adc82c714 100644 --- a/include/uv.h +++ b/include/uv.h @@ -1102,7 +1102,6 @@ UV_EXTERN int uv_queue_work(uv_loop_t* loop, UV_EXTERN int uv_cancel(uv_req_t* req); -#ifdef USE_FFRT typedef enum { uv_qos_background = 0, uv_qos_utility = 1, @@ -1115,7 +1114,6 @@ UV_EXTERN int uv_queue_work_with_qos(uv_loop_t* loop, uv_work_cb work_cb, uv_after_work_cb after_work_cb, uv_qos_t qos); -#endif struct uv_cpu_times_s { uint64_t user; /* milliseconds */ diff --git a/src/threadpool.c b/src/threadpool.c index e6c6f9844cd4d52f78c7dd7e274709b1cfddfa28..1094f42a400b099d9960a9b7ad26bf6aacf92ff9 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -482,12 +482,12 @@ int uv_queue_work(uv_loop_t* loop, } -#ifdef USE_FFRT int uv_queue_work_with_qos(uv_loop_t* loop, uv_work_t* req, uv_work_cb work_cb, uv_after_work_cb after_work_cb, uv_qos_t qos) { +#ifdef USE_FFRT if (work_cb == NULL) return UV_EINVAL; @@ -510,8 +510,10 @@ int uv_queue_work_with_qos(uv_loop_t* loop, uv__queue_work, uv__queue_done); return 0; -} +#else + return uv_queue_work(loop, req, work_cb, after_work_cb); #endif +} int uv_cancel(uv_req_t* req) {