| 177 | // Thread-safe. |
| 178 | template<typename It> |
| 179 | inline bool enqueue_bulk(It itemFirst, size_t count) |
| 180 | { |
| 181 | if ((details::likely)(inner.enqueue_bulk(std::forward<It>(itemFirst), count))) { |
| 182 | assert(static_cast<ssize_t>(count) >= 0); |
| 183 | sema->signal(static_cast<LightweightSemaphore::ssize_t>(static_cast<ssize_t>(count))); |
| 184 | return true; |
| 185 | } |
| 186 | return false; |
| 187 | } |
| 188 | |
| 189 | // Enqueues several items using an explicit producer token. |
| 190 | // Allocates memory if required. Only fails if memory allocation fails |