Returns the element at the head of the list without dequeuing or nullptr if the queue is empty. This is O(1).
| 80 | /// Returns the element at the head of the list without dequeuing or nullptr |
| 81 | /// if the queue is empty. This is O(1). |
| 82 | T* head() const { |
| 83 | std::lock_guard<LockType> lock(lock_); |
| 84 | if (IsEmptyLocked()) return nullptr; |
| 85 | return reinterpret_cast<T*>(head_); |
| 86 | } |
| 87 | |
| 88 | /// Returns the element at the end of the list without dequeuing or nullptr |
| 89 | /// if the queue is empty. This is O(1). |
no outgoing calls