/commonlibrary/ets_utils/js_concurrent_module/taskpool/ |
H A D | taskpool.cpp | 188 size_t argc = 1; // 1: long task
in TerminateTask() 201 auto task = TaskManager::GetInstance().GetTask(taskId);
in TerminateTask() local 202 if (task == nullptr || !task->IsLongTask()) {
in TerminateTask() 203 ErrorHelper::ThrowError(env, ErrorHelper::TYPE_ERROR, "the type of the params must be long task.");
in TerminateTask() 239 Task* task = nullptr;
in Execute() local 240 napi_unwrap(env, args[0], reinterpret_cast<void**>(&task));
in Execute() 241 if (task == nullptr) {
in Execute() 242 ErrorHelper::ThrowError(env, ErrorHelper::TYPE_ERROR, "the type of the first param must be task.");
in Execute() 245 if (!task in Execute() 261 Task* task = Task::GenerateFunctionTask(env, args[0], args + 1, argc - 1, TaskType::FUNCTION_TASK); Execute() local 275 auto task = TaskManager::GetInstance().GetTask(taskMessage->taskId); DelayTask() local 320 Task* task = nullptr; ExecuteDelayed() local 387 Task* task = nullptr; ExecuteGroup() local 410 auto task = static_cast<Task*>(req->data); HandleTaskResult() local 428 HandleTaskResultCallback(Task* task) HandleTaskResultCallback() argument 477 TriggerTask(Task* task) TriggerTask() argument 505 UpdateGroupInfoByResult(napi_env env, Task* task, napi_value res, bool success) UpdateGroupInfoByResult() argument 539 auto task = TaskManager::GetInstance().GetTask(taskId); UpdateGroupInfoByResult() local 559 ExecuteTask(napi_env env, Task* task, Priority priority) ExecuteTask() argument 633 Task* task = reinterpret_cast<Task*>(handle->data); PeriodicTaskCallback() local 691 TriggerTimer(napi_env env, Task* task, int32_t period) TriggerTimer() argument 710 CheckDelayedParams(napi_env env, napi_callback_info cbinfo, uint32_t &priority, int32_t &delayTime, Task* &task) CheckDelayedParams() argument [all...] |
H A D | worker.cpp | 37 HILOG_DEBUG("taskpool:: reset worker priority to match task priority");
in PriorityScope() 154 auto task = std::move(worker->debuggerQueue_.front());
in HandleDebuggerTask() local 157 task();
in HandleDebuggerTask() 160 void Worker::DebuggerOnPostTask(std::function<void()>&& task)
in DebuggerOnPostTask() argument 165 debuggerQueue_.push(std::move(task));
in DebuggerOnPostTask() 241 // Init worker task execute signal
in ExecuteInThread() 248 // Init debugger task post signal
in ExecuteInThread() 274 workerEngine->SetDebuggerPostTaskFunc([this](std::function<void()>&& task) {
in PrepareForWorkerInstance() 275 this->DebuggerOnPostTask(std::move(task));
in PrepareForWorkerInstance() 394 Task* task in PerformTask() local 457 NotifyTaskResult(napi_env env, Task* task, napi_value result) NotifyTaskResult() argument 479 NotifyHandleTaskResult(Task* task) NotifyHandleTaskResult() argument 514 Task* task = static_cast<Task*>(data); TaskResultCallback() local 556 InitTaskPoolFunc(napi_env env, napi_value func, Task* task) InitTaskPoolFunc() argument 601 UpdateLongTaskInfo(Task* task) UpdateLongTaskInfo() argument 621 HandleFunctionException(napi_env env, Task* task) HandleFunctionException() argument [all...] |
H A D | task_group.cpp | 99 Task* task = nullptr; in AddTask() local 100 napi_unwrap(env, args[0], reinterpret_cast<void**>(&task)); in AddTask() 101 if (task == nullptr) { in AddTask() 102 ErrorHelper::ThrowError(env, ErrorHelper::TYPE_ERROR, "the type of the params must be task."); in AddTask() 105 if (!task->CanForTaskGroup(env)) { in AddTask() 108 task->taskType_ = TaskType::GROUP_COMMON_TASK; in AddTask() 109 task->groupId_ = groupId; in AddTask() 110 napi_reference_ref(env, task->taskRef_, nullptr); in AddTask() 111 TaskGroupManager::GetInstance().AddTask(groupId, task->taskRef_, task in AddTask() 115 Task* task = Task::GenerateFunctionTask(env, args[0], args + 1, argc - 1, TaskType::GROUP_FUNCTION_TASK); AddTask() local 154 Task* task = nullptr; NotifyGroupTask() local [all...] |
H A D | task.cpp | 16 #include "task.h" 47 errMessage = "taskpool:: create task need more than one param"; in TaskConstructor() 58 // if the first is task name, the second might be func in TaskConstructor() 70 errMessage = "taskpool:: the first or second param of task must be function"; in TaskConstructor() 73 "the type of the first or second param of task must be function."); in TaskConstructor() 77 Task* task = GenerateTask(env, thisVar, func, name, args, argc); in TaskConstructor() local 78 TaskManager::GetInstance().StoreTask(task->taskId_, task); in TaskConstructor() 79 napi_wrap(env, thisVar, task, TaskDestructor, nullptr, nullptr); in TaskConstructor() 80 napi_create_reference(env, thisVar, 0, &task in TaskConstructor() 90 Task* task; LongTaskConstructor() local 98 Task* task = static_cast<Task*>(data); TaskDestructor() local 131 Task* task = static_cast<Task*>(arg); CleanupHookFunc() local 156 Task* task = new Task(env, TaskType::TASK, nameStr); GenerateTask() local 201 Task* task = new Task(env, type, nameStr); GenerateFunctionTask() local 212 GetTaskInfoPromise(napi_env env, napi_value task, TaskType taskType, Priority priority) GetTaskInfoPromise() argument 276 Task* task = nullptr; SetTransferList() local 336 Task* task = nullptr; SetCloneList() local 374 Task* task = static_cast<Task*>(data); IsCanceled() local 414 auto task = TaskManager::GetInstance().GetTask(taskId); OnReceiveData() local 447 Task* task = nullptr; SendData() local 489 Task* task = nullptr; AddDependency() local 577 Task* task = nullptr; RemoveDependency() local 721 Task* task = nullptr; OnEnqueued() local 759 Task* task = nullptr; OnStartExecution() local 809 Task* task = nullptr; OnExecutionFailed() local 847 Task* task = nullptr; OnExecutionSucceeded() local 869 Task* task = nullptr; IsDone() local 885 Task* task = nullptr; GetTaskDuration() local 914 Task* task = nullptr; GetName() local [all...] |
H A D | task_manager.cpp | 117 for (auto& [_, task] : tasks_) { in ~TaskManager() 118 delete task; in ~TaskManager() 119 task = nullptr; in ~TaskManager() 182 for (const auto& [_, task] : tasks_) { in GetTaskInfos() 183 if (task->taskState_ == ExecuteState::NOT_FOUND || task->taskState_ == ExecuteState::DELAYED || in GetTaskInfos() 184 task->taskState_ == ExecuteState::FINISHED) { in GetTaskInfos() 188 std::lock_guard<RECURSIVE_MUTEX> lock(task->taskMutex_); in GetTaskInfos() 189 napi_value taskId = NapiHelper::CreateUint32(env, task->taskId_); in GetTaskInfos() 191 napi_create_string_utf8(env, task in GetTaskInfos() 596 Task* task = GetTask(taskId); CancelTask() local 644 CancelSeqRunnerTask(napi_env env, Task *task) CancelSeqRunnerTask() argument 746 Task* task = GetTask(taskId); EnqueueTaskId() local 950 auto task = reinterpret_cast<Task*>(taskId); DecreaseRefCount() local 962 NotifyCallbackExecute(napi_env env, TaskResultInfo* resultInfo, Task* task) NotifyCallbackExecute() argument 1302 ReleaseTaskData(napi_env env, Task* task, bool shouldDeleteTask) ReleaseTaskData() argument 1350 ReleaseCallBackInfo(Task* task) ReleaseCallBackInfo() argument 1394 StoreTask(uint64_t taskId, Task* task) StoreTask() argument 1446 PostTask(std::function<void()> task, const char* taskName, Priority priority) PostTask() argument 1489 Task* task = TaskManager::GetInstance().GetTask(taskId); ReleaseTaskGroupData() local 1549 auto task = TaskManager::GetInstance().GetTask(taskId); CancelGroupTask() local 1588 AddTaskToSeqRunner(uint64_t seqRunnerId, Task* task) AddTaskToSeqRunner() argument 1624 Task* task = seqRunner->seqRunnerTasks_.front(); TriggerSeqRunner() local 1647 DisposeCanceledTask(napi_env env, Task* task) DisposeCanceledTask() argument [all...] |
H A D | sequence_runner.cpp | 117 errMessage = "seqRunner:: first param must be task."; in Execute() 119 ErrorHelper::ThrowError(env, ErrorHelper::TYPE_ERROR, "the type of the first param must be task."); in Execute() 128 Task* task = nullptr; in Execute() local 129 napi_unwrap(env, args[0], reinterpret_cast<void**>(&task)); in Execute() 130 if (task == nullptr) { in Execute() 131 ErrorHelper::ThrowError(env, ErrorHelper::TYPE_ERROR, "the type of param must be task."); in Execute() 134 if (!task->CanForSequenceRunner(env)) { in Execute() 137 task->seqRunnerId_ = seqRunnerId; in Execute() 138 napi_value promise = task->GetTaskInfoPromise(env, args[0], TaskType::SEQRUNNER_TASK, seqRunner->priority_); in Execute() 145 std::to_string(task in Execute() [all...] |
H A D | taskpool.h | 22 #include "task.h"
40 static void HandleTaskResultCallback(Task* task);
60 static void UpdateGroupInfoByResult(napi_env env, Task* task, napi_value res, bool success);
61 static void ExecuteTask(napi_env env, Task* task, Priority priority = Priority::DEFAULT);
64 static void TriggerTask(Task* task);
65 static void TriggerTimer(napi_env env, Task* task, int32_t period);
68 Task* &task);
70 Task* &task);
|
/commonlibrary/ets_utils/js_concurrent_module/taskpool/test/ |
H A D | test.cpp | 21 #include "task.h"
182 Task* task = reinterpret_cast<Task*>(handle->data);
in UpdateGroupInfoByResult() local 183 TaskPool::UpdateGroupInfoByResult(env, task, res, success);
in UpdateGroupInfoByResult() 329 Task* task = new Task();
in CancelTask() local 330 task->taskType_ = TaskType::COMMON_TASK;
in CancelTask() 331 task->taskId_ = reinterpret_cast<uint64_t>(task);
in CancelTask() 334 task->taskRef_ = ref;
in CancelTask() 335 taskManager.StoreTask(task->taskId_, task);
in CancelTask() 364 Task* task = new Task(); NotifyWorkerIdle() local 381 Task* task = new Task(); EnqueueTaskId() local 402 Task* task = new Task(); GetTaskByPriority() local 427 Task* task = new Task(); RestoreWorker() local 476 Task* task = new Task(); NotifyDependencyTaskInfo() local 500 Task* task = new Task(); StoreTaskDependency() local 538 Task* task = new Task(); RemoveTaskDependency() local 565 Task* task = new Task(); ReleaseTaskData() local 600 Task* task = new Task(); CheckTask() local 652 Task* task = new Task(); CancelGroupTask() local 675 Task* task = new Task(); TriggerSeqRunner() local 716 Task* task = new Task(); UpdateGroupState() local 807 Task* task = new Task(); PerformTask() local 831 Task* task = new Task(); NotifyHandleTaskResult() local 850 Task* task = new Task(); TaskResultCallback() local 886 Task* task = new Task(); HandleFunctionException() local [all...] |
H A D | test_taskpool.cpp | 22 #include "task.h" 47 napi_value task = nullptr; in GeneratorTask() local 49 napi_call_function(env, thisVar, cb, 1, argv, &task); in GeneratorTask() 50 return task; in GeneratorTask() 86 Task* task = Task::GenerateTask(env, thisValue, func, taskName, args, argc); in CreateTaskObject() local 87 task->UpdateTaskType(taskType); in CreateTaskObject() 89 task->taskState_ = state; in CreateTaskObject() 93 taskManager.StoreTask(task->taskId_, task); in CreateTaskObject() 96 env, thisValue, task, in CreateTaskObject() 109 Task* task = nullptr; CreateNullTaskObject() local 157 Task* task = taskManager.GetTask(taskId); HWTEST_F() local 287 Task* task = new Task(); HWTEST_F() local 299 Task* task = new Task(); HWTEST_F() local 311 Task* task = new Task(); HWTEST_F() local 383 Task* task = new Task(); HWTEST_F() local 492 Task* task = new Task(); HWTEST_F() local 516 Task* task = new Task(); HWTEST_F() local 788 Task *task = new Task(); HWTEST_F() local 922 Task* task = new Task(); HWTEST_F() local 967 auto task = reinterpret_cast<uint64_t>(pointer); HWTEST_F() local 981 Task* task = new Task(); HWTEST_F() local 1009 Task* task = new Task(); HWTEST_F() local 1019 Task* task = new Task(); HWTEST_F() local 1046 Task* task = new Task(); HWTEST_F() local 1064 Task* task = new Task(env, TaskType::COMMON_TASK, "test"); HWTEST_F() local 1370 napi_value task = nullptr; HWTEST_F() local 1482 auto task = GeneratorTask(env, global); HWTEST_F() local 1503 auto task = GeneratorTask(env, global); HWTEST_F() local 1524 auto task = GeneratorTask(env, global); HWTEST_F() local 1543 auto task = GeneratorTask(env, global); HWTEST_F() local 1565 auto task = GeneratorTask(env, obj); HWTEST_F() local 1579 auto task = GeneratorTask(env, obj); HWTEST_F() local 1604 auto task = GeneratorTask(env, obj); HWTEST_F() local 1633 auto task = GeneratorTask(env, obj); HWTEST_F() local 1649 auto task = GeneratorTask(env, obj); HWTEST_F() local 1668 auto task = GeneratorTask(env, taskObj); HWTEST_F() local 1728 auto task = GeneratorTask(env, obj); HWTEST_F() local 1742 auto task = GeneratorTask(env, obj); HWTEST_F() local 1757 auto task = GeneratorTask(env, obj); HWTEST_F() local 1774 auto task = GeneratorTask(env, obj); HWTEST_F() local 1794 auto task = GeneratorTask(env, obj); HWTEST_F() local 1811 auto task = GeneratorTask(env, obj); HWTEST_F() local 1828 auto task = GeneratorTask(env, obj); HWTEST_F() local 1858 auto task = std::make_unique<Task>(); HWTEST_F() local 1876 auto task = std::make_unique<Task>(); HWTEST_F() local 1899 auto task = std::make_unique<Task>(); HWTEST_F() local 1915 auto task = std::make_unique<Task>(); HWTEST_F() local 1940 auto task = std::make_unique<Task>(); HWTEST_F() local 1967 auto task = std::make_unique<Task>(); HWTEST_F() local 2012 Task* task = new Task(env, TaskType::COMMON_TASK, "groupTask"); HWTEST_F() local 2033 Task* task = new Task(); HWTEST_F() local 2064 Task* task = new Task(); HWTEST_F() local 2098 Task* task = new Task(); HWTEST_F() local 2142 Task* task = new Task(); HWTEST_F() local 2183 Task* task = Task::GenerateTask(env, thisValue, func, taskName, args, argc); HWTEST_F() local 2368 Task* task = Task::GenerateTask(env, obj, funcValue, taskName, args, argc); HWTEST_F() local 2412 Task* task = new Task(); HWTEST_F() local 2542 auto task = GeneratorTask(env, global); HWTEST_F() local 2562 Task* task = new Task(); HWTEST_F() local 2583 Task* task = new Task(); HWTEST_F() local 2628 Task* task = new Task(); HWTEST_F() local 2713 Task* task = new Task(); HWTEST_F() local 2746 Task* task = new Task(); HWTEST_F() local 2773 Task* task = new Task(); HWTEST_F() local 2790 Task* task = new Task(); HWTEST_F() local 2820 Task* task = nullptr; HWTEST_F() local 2843 Task* task = nullptr; HWTEST_F() local 2864 Task* task = nullptr; HWTEST_F() local 2884 Task* task = nullptr; HWTEST_F() local 2905 Task* task = nullptr; HWTEST_F() local 2926 Task* task = nullptr; HWTEST_F() local 2947 Task* task = nullptr; HWTEST_F() local 2968 Task* task = nullptr; HWTEST_F() local 3108 Task* task = nullptr; HWTEST_F() local 3132 Task* task = nullptr; HWTEST_F() local 3157 Task* task = nullptr; HWTEST_F() local 3179 Task* task = nullptr; HWTEST_F() local 3205 Task* task = nullptr; HWTEST_F() local 3243 Task* task = nullptr; HWTEST_F() local 3278 Task* task = nullptr; HWTEST_F() local 3297 Task* task = nullptr; HWTEST_F() local 3336 Task* task = nullptr; HWTEST_F() local 3378 Task* task = nullptr; HWTEST_F() local 3461 Task* task = nullptr; HWTEST_F() local 3478 Task* task = nullptr; HWTEST_F() local 3497 Task* task = nullptr; HWTEST_F() local 3517 Task* task = nullptr; HWTEST_F() local 3543 Task* task = nullptr; HWTEST_F() local 3560 Task* task = nullptr; HWTEST_F() local 3579 Task* task = nullptr; HWTEST_F() local 3599 Task* task = nullptr; HWTEST_F() local 3631 Task* task = nullptr; HWTEST_F() local 3648 Task* task = nullptr; HWTEST_F() local 3667 Task* task = nullptr; HWTEST_F() local 3687 Task* task = nullptr; HWTEST_F() local 3713 Task* task = nullptr; HWTEST_F() local 3730 Task* task = nullptr; HWTEST_F() local 3749 Task* task = nullptr; HWTEST_F() local 3769 Task* task = nullptr; HWTEST_F() local 3795 Task* task = nullptr; HWTEST_F() local 3812 Task* task = nullptr; HWTEST_F() local 3840 Task* task = nullptr; HWTEST_F() local 3869 Task* task = new Task(); HWTEST_F() local 3886 Task* task = new Task(); HWTEST_F() local 3903 Task* task = new Task(); HWTEST_F() local 3930 Task* task = new Task(); HWTEST_F() local 3960 Task* task = new Task(); HWTEST_F() local 3980 Task* task = new Task(); HWTEST_F() local 4016 Task* task = new Task(); HWTEST_F() local 4032 Task* task = new Task(); HWTEST_F() local 4059 Task* task = new Task(); HWTEST_F() local 4092 Task* task = new Task(); HWTEST_F() local 4115 Task* task = new Task(); HWTEST_F() local 4400 Task* task = nullptr; HWTEST_F() local 4426 Task* task = nullptr; HWTEST_F() local 4451 Task* task = nullptr; HWTEST_F() local 4468 Task* task = nullptr; HWTEST_F() local 4481 Task* task = nullptr; HWTEST_F() local 4500 Task* task = nullptr; HWTEST_F() local 4522 Task* task = new Task(); HWTEST_F() local 4548 Task* task = new Task(); HWTEST_F() local 4600 Task* task = new Task(); HWTEST_F() local [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/ |
H A D | block_on.rs | 18 use std::task::{Context, Poll}; 78 async fn task() -> i32 { in sdv_block_on_nest_spawn_spawn_blocking() 96 let res = runtime.block_on(task()); in sdv_block_on_nest_spawn_spawn_blocking() 98 let res = ylong_runtime::block_on(task()); in sdv_block_on_nest_spawn_spawn_blocking() 108 async fn task() -> i32 { in sdv_block_on_nest_spawn_and_spawn() 139 let res = runtime.block_on(task()); in sdv_block_on_nest_spawn_and_spawn() 141 let res = ylong_runtime::block_on(task()); in sdv_block_on_nest_spawn_and_spawn() 149 async fn task() -> i32 { in sdv_block_on_nest_spawn_nest_spawn() 175 let res = runtime.block_on(task()); in sdv_block_on_nest_spawn_nest_spawn() 177 let res = ylong_runtime::block_on(task()); in sdv_block_on_nest_spawn_nest_spawn() [all...] |
H A D | task_cancel.rs | 18 use std::task::{Context, Poll}; 24 /// SDV test cases for canceling a task. 28 /// 2. Spawn a task that takes 100 seconds 29 /// 3. Cancel the task after the task returns pending 30 /// 4. Await on the canceled task 35 let task = ylong_runtime::spawn(async move { in sdv_task_cancel_simple() 39 task.cancel(); in sdv_task_cancel_simple() 40 let res = task.await.err().unwrap(); in sdv_task_cancel_simple() 46 /// SDV test cases for canceling a task afte [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/ |
H A D | spawn.rs | 17 use crate::task::join_handle::JoinHandle; 18 use crate::task::TaskBuilder; 26 use std::task::{Context, Poll}; 46 /// Spawns a task on the blocking pool. 47 pub(crate) fn spawn_blocking<T, R>(builder: &TaskBuilder, task: T) -> JoinHandle<R> 53 let task = BlockingTask(Some(task)); 54 spawn(task, builder) 59 /// Spawns a task on the blocking pool. 60 pub(crate) fn spawn_blocking<T, R>(builder: &TaskBuilder, task [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/executor/ |
H A D | mod.rs | 16 //! - schedule policy: how tasks are scheduled in the task queues. 29 use crate::task::{JoinHandle, Task, TaskBuilder}; 51 fn schedule(&self, task: Task, lifo: bool); in schedule() 174 /// use ylong_runtime::task::*; 191 pub fn spawn<T, R>(&self, task: T) -> JoinHandle<R> in spawn() 196 self.spawn_with_attr(task, &TaskBuilder::default()) in spawn() 200 pub(crate) fn spawn_with_attr<T, R>(&self, task: T, builder: &TaskBuilder) -> JoinHandle<R> 207 AsyncHandle::CurrentThread(current_thread) => current_thread.spawn(builder, task), 209 AsyncHandle::MultiThread(async_spawner) => async_spawner.spawn(builder, task), 211 AsyncHandle::FfrtMultiThread => spawn(task, builde [all...] |
H A D | queue.rs | 26 use crate::task::{Header, Task}; 83 pub(crate) fn push_back(&self, task: Task, global: &GlobalQueue) { 84 self.inner.push_back(task, global); 139 /// The total number of task which has entered this LocalQueue 141 /// The total number of task which has entered this LocalQueue from 144 /// The total number of task which has entered GlobalQueue from this 158 /// Returns the total number of task which has entered this LocalQueue 163 /// Returns the total number of task which has entered this LocalQueue from 169 /// Returns the total number of task which has entered GlobalQueue from this 232 let task [all...] |
H A D | async_pool.rs | 32 use crate::task::{JoinHandle, Task, TaskBuilder, VirtualTableType}; 60 fn schedule(&self, task: Task, lifo: bool) { in schedule() 61 if self.enqueue(task, lifo) { in schedule() 182 fn enqueue_under_ctx(&self, mut task: Task, worker_ctx: &WorkerContext, lifo: bool) -> bool { in enqueue_under_ctx() 185 self.global.push_back(task); in enqueue_under_ctx() 193 // there is some task in lifo slot, therefore we put the prev task in enqueue_under_ctx() 194 // into run queue, and put the current task into the lifo slot in enqueue_under_ctx() 195 *lifo_slot = Some(task); in enqueue_under_ctx() 196 task in enqueue_under_ctx() [all...] |
H A D | blocking_pool.rs | 19 use std::task::{Context, Poll}; 26 use crate::task; 27 use crate::task::{JoinHandle, TaskBuilder, VirtualTableType}; 166 type Task = task::Task; 194 pub(crate) fn spawn_blocking<T, R>(&self, builder: &TaskBuilder, task: T) -> JoinHandle<R> 200 let task = BlockingTask(Some(task)); 202 let (task, handle) = Task::create_task(builder, scheduler, task, VirtualTableType::Ylong); 203 self.spawn(task); [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/task/ |
H A D | mod.rs | 34 pub(crate) use crate::task::raw::{Header, RawTask, TaskMngInfo}; 100 task: T, 108 let raw = Task::create_raw_task::<T, S>(builder, scheduler, task, virtual_table_type); 117 task: T, 127 task, 134 panic!("task mem is null because not enough memory is available"); 140 /// Using the default task setting, spawns a task onto the global runtime. 141 pub fn spawn<T, R>(task: T) -> JoinHandle<R> in spawn() 147 TaskBuilder::new().spawn(task) in spawn() [all...] |
H A D | task_handle.rs | 17 use std::task::{Context, Poll, Waker}; 21 use crate::task::raw::{Header, Inner, TaskMngInfo}; 22 use crate::task::state; 23 use crate::task::state::StateAction; 24 use crate::task::waker::WakerRefHeader; 27 use crate::task::Task; 31 task: NonNull<TaskMngInfo<T, S>>, 41 task: ptr.cast::<TaskMngInfo<T, S>>(), 46 unsafe { self.task.as_ref().header() } in header() 50 unsafe { self.task in inner() [all...] |
H A D | builder.rs | 14 //! Builder to configure the task. Tasks that get spawned through 17 //! A task has following attributes: 19 //! - task name 24 use crate::task::{JoinHandle, Qos}; 48 /// Sets the name of the task. 54 /// Sets the qos of the task 61 /// Using the current task setting, spawns a task onto the global runtime. 62 pub fn spawn<T, R>(&self, task: T) -> JoinHandle<R> in spawn() 68 spawn_async(self, task) in spawn() [all...] |
/commonlibrary/c_utils/base/test/unittest/common/ |
H A D | utils_thread_pool_test.cpp | 102 // add no task, g_times has no change in HWTEST_F() 119 // simple task, total task num less than the MaxTaskNum 130 auto task = std::bind(TestFuncAddOneTime, i); in HWTEST_F() local 131 pool.AddTask(task); in HWTEST_F() 136 auto task = std::bind(TestFuncSubOneTime, i); in HWTEST_F() local 137 pool.AddTask(task); in HWTEST_F() 147 // simaple task, total task num exceed the MaxTaskNum and the threads num 160 auto task in HWTEST_F() local 166 auto task = std::bind(TestFuncSubOneTime, i); HWTEST_F() local 208 auto task = std::bind(TestFuncAddWait, i); HWTEST_F() local 214 auto task = std::bind(TestFuncSubWait, i); HWTEST_F() local 246 auto task = std::bind(TestFuncAddWait, i); HWTEST_F() local 252 auto task = std::bind(TestFuncSubWait, i); HWTEST_F() local 300 auto task = std::bind(TestFuncGetName, poolName); HWTEST_F() local [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/fs/ |
H A D | mod.rs | 32 use crate::task::TaskBuilder; 34 pub(crate) async fn async_op<T, R>(task: T) -> io::Result<R> 40 spawn_blocking(&TaskBuilder::new(), task) 48 std::task::Poll::Ready(t) => t, 49 std::task::Poll::Pending => return Poll::Pending,
|
/commonlibrary/c_utils/base/src/ |
H A D | thread_pool.cpp | 103 Task task; in ScheduleTask() local 105 task = tasks_.front(); in ScheduleTask() 112 return task; in ScheduleTask() 123 Task task = ScheduleTask(); in WorkInThread() local 124 if (task) { in WorkInThread() 125 task(); in WorkInThread()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/benches/ |
H A D | ylong_tokio_async_file.rs | 37 let task = || async { in async_read() 47 runtime.block_on(task()); in async_read() 61 let task = || async { in async_read_by_chars() 73 runtime.block_on(task()); in async_read_by_chars() 88 let task = || async { in async_write() 97 runtime.block_on(task()); in async_write()
|
H A D | ylong_tokio_file.rs | 63 let task = || async { 66 runtime.block_on(task()); 89 let task = || async { 92 runtime.block_on(task()); 117 let task = || async { 120 ylong_runtime::block_on(task()); 148 let task = || async { 151 ylong_runtime::block_on(task());
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/ffrt/ |
H A D | spawner.rs | 23 use crate::task::{JoinHandle, Task, TaskBuilder, VirtualTableType}; 66 pub fn spawn<F>(task: F, builder: &TaskBuilder) -> JoinHandle<F::Output> in spawn() 72 let (task, join_handle) = Task::create_task(builder, scheduler, task, VirtualTableType::Ffrt); in spawn() 74 ffrt_submit(task, builder); in spawn()
|