| 133 | |
| 134 | template<typename Closure> |
| 135 | __forceinline void push_right(Thread& thread, const size_t size, const Closure& closure, TaskGroupContext* context) |
| 136 | { |
| 137 | if (right >= TASK_STACK_SIZE) |
| 138 | throw std::runtime_error("task stack overflow"); |
| 139 | |
| 140 | /* allocate new task on right side of stack */ |
| 141 | size_t oldStackPtr = stackPtr; |
| 142 | TaskFunction* func = new (alloc(sizeof(ClosureTaskFunction<Closure>))) ClosureTaskFunction<Closure>(closure); |
| 143 | new (&tasks[right.load()]) Task(func,thread.task,context,oldStackPtr,size); |
| 144 | right++; |
| 145 | |
| 146 | /* also move left pointer */ |
| 147 | if (left >= right-1) left = right-1; |
| 148 | } |
| 149 | |
| 150 | dll_export bool execute_local(Thread& thread, Task* parent); |
| 151 | bool execute_local_internal(Thread& thread, Task* parent); |
no test coverage detected