MCPcopy Create free account
hub / github.com/XpuOS/xsched / GetXQueueStatus

Method GetXQueueStatus

service/server/src/server.cpp:210–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210bool Server::GetXQueueStatus(XQueueHandle handle, XQueueStatus &status)
211{
212 static std::mutex query_mtx;
213 std::lock_guard<std::mutex> lock(query_mtx);
214
215 static StatusQuery query(false); // only query XQueue status
216 query.Reset();
217 query.status_.reserve(128);
218
219 auto e = std::make_unique<XQueueQueryEvent>(handle, &query);
220 XASSERT(self_chan_->Send(e->Data(), e->Size()), "cannot send XQueue query event");
221 query.Wait();
222
223 if (query.status_.empty()) return false;
224 status = *query.status_[0];
225 return true;
226}
227
228void Server::GetXQueue(const httplib::Request &req, httplib::Response &res)
229{

Callers

nothing calls this directly

Calls 4

ResetMethod · 0.45
DataMethod · 0.45
SizeMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected