MCPcopy Create free account
hub / github.com/acl-dev/acl / fiber_create

Method fiber_create

lib_fiber/cpp/src/fiber_pool.cpp:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void fiber_pool::fiber_create(size_t count)
55{
56 for (size_t i = 0; i < count; i++) {
57 wg_->add(1);
58
59 auto* box2 = new fiber_sbox2<task_fn>(box_buf_);
60 auto* box = new task_box<task_fn>(box2);
61 boxes_[box_count_] = box;
62 box->idx = (int) box_count_++;
63
64 if (stack_share_) {
65 go_share(stack_size_)[this, box] {
66 fiber_run(box);
67 delete box;
68 };
69 } else {
70 go_stack(stack_size_)[this, box] {
71 fiber_run(box);
72 delete box;
73 };
74 }
75 }
76}
77
78void fiber_pool::fiber_run(task_box<task_fn>* box)
79{

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected