MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / asyncProcess

Method asyncProcess

src/GraphCtrl/GraphEvent/GEvent.cpp:64–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63
64std::shared_future<CVoid> GEvent::asyncProcess(GEventAsyncStrategy strategy) {
65 CGRAPH_ASSERT_NOT_NULL_THROW_ERROR(thread_pool_)
66 std::shared_future<CVoid> future = thread_pool_->commit([this] {
67 this->trigger(this->param_);
68 }, CGRAPH_POOL_TASK_STRATEGY);
69
70 /**
71 * 根据具体策略,将 future信息放到对应的容器中
72 * 在特定的时间点,等待执行结束
73 */
74 if (GEventAsyncStrategy::PIPELINE_RUN_FINISH == strategy) {
75 CGRAPH_LOCK_GUARD lock(async_run_finished_lock_);
76 async_run_finish_futures_.emplace_back(future);
77 } else if (GEventAsyncStrategy::PIPELINE_DESTROY == strategy) {
78 CGRAPH_LOCK_GUARD lock(async_destroy_lock_);
79 async_destroy_futures_.emplace_back(future);
80 }
81 return future;
82}
83
84
85CVoid GEvent::asyncWait(GEventAsyncStrategy strategy) {

Callers 6

async_pipeline_1Function · 0.45
async_pipeline_2Function · 0.45
async_pipeline_1Function · 0.45
async_pipeline_2Function · 0.45
async_pipeline_3Function · 0.45
asyncTriggerMethod · 0.45

Calls 1

triggerMethod · 0.45

Tested by

no test coverage detected