| 139 | } |
| 140 | |
| 141 | bool erase_first(ValueType& out) { |
| 142 | std::lock_guard lock{mutex}; |
| 143 | auto it = map.items().begin(); |
| 144 | |
| 145 | if (it == map.items().end()) { |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | out = it->second; |
| 150 | map.erase(it->first); |
| 151 | return true; |
| 152 | } |
| 153 | |
| 154 | size_t size() { |
| 155 | std::lock_guard lock{mutex}; |