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

Method InsertQueue

executor/lib/generic_dev_executor.cpp:55–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void GenericDevExecutor::InsertQueue(GenericDevExecutor::QueueType queue_type, SubgraphTask* task)
56{
57 std::mutex* p_mutex = nullptr;
58 task_queue_t* p_queue = nullptr;
59
60 if(!GetQueueReference(queue_type, p_mutex, p_queue))
61 return;
62
63 Lock(*p_mutex);
64
65 // first one?
66
67 auto ir = p_queue->find(task->exec_priority);
68
69 if(ir == p_queue->end())
70 {
71 std::set<SubgraphTask*> set;
72 set.insert(task);
73 (*p_queue)[task->exec_priority] = set;
74 }
75 else
76 {
77 ir->second.insert(task);
78 }
79
80 Unlock(*p_mutex);
81}
82bool GenericDevExecutor::RemoveQueue(QueueType queue_type, SubgraphTask* task)
83{
84 std::mutex* p_mutex = nullptr;

Callers

nothing calls this directly

Calls 2

endMethod · 0.80
GetStatusMethod · 0.45

Tested by

no test coverage detected