!48 ffrt 支持无栈协程

Merge pull request !48 from wanghuachen/master
This commit is contained in:
openharmony_ci 2023-07-26 06:06:31 +00:00 committed by Gitee
commit d071a9caf3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 36 additions and 1 deletions

View File

@ -259,7 +259,7 @@ void ffrt_wake_by_handle(void* callable, ffrt_function_ptr_t exec, ffrt_function
FFRT_COND_DO_ERR((exec == nullptr), return, "input valid,exec == nullptr");
FFRT_COND_DO_ERR((destroy == nullptr), return, "input valid,destroy == nullptr");
FFRT_COND_DO_ERR((handle == nullptr), return, "input valid,handle == nullptr");
ffrt::TaskCtx * task=static_cast<ffrt::TaskCtx*>(CVT_HANDLE_TO_TASK(handle));
ffrt::TaskCtx *task = static_cast<ffrt::TaskCtx*>(handle);
task->lock.lock();
FFRT_LOGW("tid:%ld ffrt_wake_by_handle and CurState = %d", syscall(SYS_gettid), task->state.CurState());

View File

@ -328,6 +328,41 @@ ohos_unittest("qos_convert_test") {
part_name = "ffrt"
}
ohos_unittest("ut_coroutine_test") {
module_out_path = module_output_path
configs = [ ":ffrt_test_config" ]
cflags_cc = [
"-frtti",
"-Xclang",
"-fcxx-exceptions",
"-std=c++11",
"-DFFRT_PERF_EVENT_ENABLE",
]
sources = [ "ut_coroutine_test.cpp" ]
deps = [
"../..:libffrt",
"//third_party/googletest:gtest",
"//third_party/jsoncpp:jsoncpp",
]
external_deps = [
"c_utils:utils",
"eventhandler:libeventhandler",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr:samgr_proxy",
]
if (is_standard_system) {
public_deps = gtest_public_deps
}
install_enable = true
part_name = "ffrt"
}
group("ffrt_unittest_ffrt") {
testonly = true