MCPcopy Create free account
hub / github.com/ZDoom/Raze / WaitForWorkers

Method WaitForWorkers

source/common/rendering/r_thread.cpp:89–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void DrawerThreads::WaitForWorkers()
90{
91 using namespace std::chrono_literals;
92
93 // Wait for workers to finish
94 auto queue = Instance();
95 std::unique_lock<std::mutex> end_lock(queue->end_mutex);
96 if (!queue->end_condition.wait_for(end_lock, 5s, [&]() { return queue->tasks_left == 0; }))
97 {
98 I_FatalError("Drawer threads did not finish within 5 seconds!");
99 }
100 end_lock.unlock();
101
102 // Clean up
103 std::unique_lock<std::mutex> start_lock(queue->start_mutex);
104 for (auto &thread : queue->threads)
105 thread.current_queue = 0;
106
107 for (auto &list : queue->active_commands)
108 {
109 for (auto &command : list->commands)
110 command->~DrawerCommand();
111 list->Clear();
112 }
113 queue->active_commands.clear();
114}
115
116void DrawerThreads::WorkerMain(DrawerThread *thread)
117{

Callers

nothing calls this directly

Calls 5

I_FatalErrorFunction · 0.85
~DrawerCommandMethod · 0.80
unlockMethod · 0.45
ClearMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected