template<typename taskType = std::function<void()>>
ppqsort::impl::cpp::TaskStack class

Constructors, destructors, conversion operators

TaskStack(TaskStack&) deleted
TaskStack()

Public functions

auto try_push(taskType&& task) -> bool
Try to push a task to the stack.
auto push(taskType&& task) -> void
Push a task to the stack. If the stack is held by another thread, wait until it is released.
auto try_pop() -> std::optional<taskType>
Try to pop a task from the stack.
auto pop() -> std::optional<taskType>
Pop a task from the stack. If the stack is held by another thread, wait until it is released.

Function documentation

template<typename taskType _1>
bool ppqsort::impl::cpp::TaskStack<_1>::try_push(taskType&& task)

Try to push a task to the stack.

Parameters
task
Returns true if the task was successfully pushed, false otherwise (stack is held by other thread).

template<typename taskType _1>
void ppqsort::impl::cpp::TaskStack<_1>::push(taskType&& task)

Push a task to the stack. If the stack is held by another thread, wait until it is released.

Parameters
task

template<typename taskType _1>
std::optional<taskType> ppqsort::impl::cpp::TaskStack<_1>::try_pop()

Try to pop a task from the stack.

Returns std::nullopt if the stack is empty or held by another thread, task otherwise.

template<typename taskType _1>
std::optional<taskType> ppqsort::impl::cpp::TaskStack<_1>::pop()

Pop a task from the stack. If the stack is held by another thread, wait until it is released.

Returns std::nullopt if the stack is empty, task otherwise.