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

Method run_internal

common/tasking/taskschedulerinternal.cpp:42–68  ·  view source on GitHub ↗

! run this task */

Source from the content-addressed store, hash-verified

40
41 /*! run this task */
42 void TaskScheduler::Task::run_internal (Thread& thread) // FIXME: avoid as many dll_exports as possible
43 {
44 /* try to run if not already stolen */
45 if (try_switch_state(INITIALIZED,DONE))
46 {
47 Task* prevTask = thread.task;
48 thread.task = this;
49 try {
50 if (context->cancellingException == nullptr)
51 closure->execute();
52 } catch (...) {
53 if (context->cancellingException == nullptr)
54 context->cancellingException = std::current_exception();
55 }
56 thread.task = prevTask;
57 add_dependencies(-1);
58 }
59
60 /* steal until all dependencies have completed */
61 steal_loop(thread,
62 [&] () { return dependencies>0; },
63 [&] () { while (thread.tasks.execute_local_internal(thread,this)); });
64
65 /* now signal our parent task that we are finished */
66 if (parent)
67 parent->add_dependencies(-1);
68 }
69
70 /*! run this task */
71 dll_export void TaskScheduler::Task::run (Thread& thread) {

Callers 1

Calls 3

add_dependenciesMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected