| 137 | } |
| 138 | |
| 139 | TaskGroup* TaskControl::create_group(bthread_tag_t tag) { |
| 140 | TaskGroup* g = new (std::nothrow) TaskGroup(this); |
| 141 | if (NULL == g) { |
| 142 | LOG(FATAL) << "Fail to new TaskGroup"; |
| 143 | return NULL; |
| 144 | } |
| 145 | if (g->init(FLAGS_task_group_runqueue_capacity) != 0) { |
| 146 | LOG(ERROR) << "Fail to init TaskGroup"; |
| 147 | delete g; |
| 148 | return NULL; |
| 149 | } |
| 150 | if (_add_group(g, tag) != 0) { |
| 151 | delete g; |
| 152 | return NULL; |
| 153 | } |
| 154 | return g; |
| 155 | } |
| 156 | |
| 157 | static void print_rq_sizes_in_the_tc(std::ostream &os, void *arg) { |
| 158 | TaskControl *tc = (TaskControl *)arg; |