MCPcopy Create free account
hub / github.com/cuberite/cuberite / TryDequeueItem

Method TryDequeueItem

src/OSSupport/Queue.h:86–97  ·  view source on GitHub ↗

Dequeues an item from the queue if any are present. Returns true if successful. Value of item is undefined if dequeuing was unsuccessful.

Source from the content-addressed store, hash-verified

84 /// Dequeues an item from the queue if any are present.
85 /// Returns true if successful. Value of item is undefined if dequeuing was unsuccessful.
86 bool TryDequeueItem(ItemType & item)
87 {
88 cCSLock Lock(m_CS);
89 if (m_Contents.size() == 0)
90 {
91 return false;
92 }
93 item = m_Contents.front();
94 m_Contents.pop_front();
95 m_evtRemoved.Set();
96 return true;
97 }
98
99
100 /// Dequeues an item from the queue, blocking until an item is available.

Callers 2

LoadOneChunkMethod · 0.80
SaveOneChunkMethod · 0.80

Calls 2

sizeMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected