MCPcopy Create free account
hub / github.com/RenderKit/embree / push_right

Method push_right

common/tasking/taskschedulerinternal.h:135–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 2

spawn_rootMethod · 0.80
spawnMethod · 0.80

Calls 2

allocFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected