Documentation Home >> Headers >> <jss/mpsc_fifo.hpp> Header >> jss::mpsc_fifo >> jss::mpsc_fifo::push member function

Add a new element to the end of the queue.

template<typename U>
void push(U&& value);

Requires:

T must be MoveConstructible

Effects:

Move-construct value into a new element added to the end of the queue. If an exception is thrown then this function has no effects.

Throws:

std::bad_alloc if memory could not be allocated for the new element. Any exceptions thrown by the move constructor of T. jss::poisoned_queue if *this has been poisoned.

Synchronization:

Multiple threads may call push() on the same instance of jss::mpsc_fifo concurrently without external synchronization. If a call to push() from one thread happens-before a call to push() from another thread then the value pushed by the first thread will be popped before the element from the second. If two threads call push() and neither call happens-before the other then the order in which those values will be popped is unspecified.

A successful call to push() synchronizes-with a call to pop() or try_pop() that retrieves the value pushed.

Header

#include <jss/mpsc_fifo.hpp>

See Also