MCPcopy Create free account
hub / github.com/alibaba/libgrape-lite / Get

Method Get

grape/utils/concurrent_queue.h:224–234  ·  view source on GitHub ↗

* @brief Get an entity from this queue. * * This function won't be blocked. * * @param item Reference of an entity to hold the got data. * * @return If got data, return true. Otherwise, return false. */

Source from the content-addressed store, hash-verified

222 * @return If got data, return true. Otherwise, return false.
223 */
224 bool Get(T& item) {
225 bool ret = false;
226 lock_.lock();
227 if (!queue_.empty()) {
228 ret = true;
229 item = std::move(queue_.front());
230 queue_.pop_front();
231 }
232 lock_.unlock();
233 return ret;
234 }
235
236 void Clear() {
237 lock_.lock();

Callers

nothing calls this directly

Calls 3

lockMethod · 0.80
unlockMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected