Dequeues an item from the queue if any are present. Returns true if successful. Value of item is undefined if dequeuing was unsuccessful.
| 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. |
no test coverage detected