Add an element to the queue and notify one client.
| 271 | |
| 272 | // Add an element to the queue and notify one client. |
| 273 | void put(T&& t) |
| 274 | { |
| 275 | synchronized (mutex) { |
| 276 | queue.push(std::forward<T>(t)); |
| 277 | cond.notify_one(); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | // NOTE: This function blocks the thread. It returns the oldest |
| 282 | // element from the queue and returns None() if the queue is |