Enqueues a single item (by copying it). Allocates memory if required. Only fails if memory allocation fails (or implicit production is disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE is 0, or Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). Thread-safe.
| 523 | // or Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). |
| 524 | // Thread-safe. |
| 525 | inline bool enqueue(T const& item) |
| 526 | { |
| 527 | if (details::likely(inner.enqueue(item))) { |
| 528 | sema->signal(); |
| 529 | return true; |
| 530 | } |
| 531 | return false; |
| 532 | } |
| 533 | |
| 534 | // Enqueues a single item (by moving it, if possible). |
| 535 | // Allocates memory if required. Only fails if memory allocation fails (or implicit |