MCPcopy Create free account
hub / github.com/OAID/Tengine / PopQueue

Method PopQueue

executor/lib/generic_dev_executor.cpp:111–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 return ret;
110}
111SubgraphTask* GenericDevExecutor::PopQueue(QueueType queue_type)
112{
113 std::mutex* p_mutex = nullptr;
114 task_queue_t* p_queue = nullptr;
115
116 if(!GetQueueReference(queue_type, p_mutex, p_queue))
117 return nullptr;
118
119 Lock(*p_mutex);
120
121 auto ir = p_queue->begin();
122
123 if(ir == p_queue->end())
124 {
125 Unlock(*p_mutex);
126 return nullptr;
127 }
128
129 auto set_ir = ir->second.begin();
130
131 SubgraphTask* task = *set_ir;
132
133 ir->second.erase(set_ir);
134
135 if(ir->second.empty())
136 {
137 p_queue->erase(ir);
138 }
139
140 Unlock(*p_mutex);
141 return task;
142}
143int GenericDevExecutor::GetElementNumber(QueueType queue_type)
144{
145 std::mutex* p_mutex;

Callers

nothing calls this directly

Calls 3

beginMethod · 0.80
endMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected