| 363 | // Never allocates. Thread-safe. |
| 364 | template<typename U> |
| 365 | inline void wait_dequeue(U& item) |
| 366 | { |
| 367 | while (!sema->wait()) { |
| 368 | continue; |
| 369 | } |
| 370 | while (!inner.try_dequeue(item)) { |
| 371 | continue; |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | // Blocks the current thread until either there's something to dequeue |
| 376 | // or the timeout (specified in microseconds) expires. Returns false |