diff options
author | Norbert Preining <norbert@preining.info> | 2023-06-08 03:01:59 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-06-08 03:01:59 +0000 |
commit | 538e6d6e7c75b7cca5470604811205f9dbd55c03 (patch) | |
tree | 4807afb694acc9e4ecff2d466d5e37788127d6fb /graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h | |
parent | 5c99135c06494b236cce7fd76e346851cf8c4408 (diff) |
CTAN sync 202306080301
Diffstat (limited to 'graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h')
-rw-r--r-- | graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h index 3e1ba547ca..e8fc6d13ea 100644 --- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h +++ b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h @@ -1,6 +1,6 @@ #pragma once -#include <boost/optional/optional.hpp> +#include <optional> #include <algorithm> #include <atomic> #include <condition_variable> @@ -11,6 +11,7 @@ #include <utility> #include <vector> +#include "optionalVersion.h" struct MultiQueueWaiter; @@ -156,7 +157,7 @@ struct ThreadedQueue : public BaseThreadQueue { // Get the first element from the queue without blocking. Returns a null // value if the queue is empty. - boost::optional<T> TryDequeue(bool priority) { + optional<T> TryDequeue(bool priority) { std::lock_guard<std::mutex> lock(mutex); auto pop = [&](std::deque<T>* q) { @@ -167,7 +168,7 @@ struct ThreadedQueue : public BaseThreadQueue { }; auto get_result = [&](std::deque<T>* first, - std::deque<T>* second) -> boost::optional<T> { + std::deque<T>* second) -> optional<T> { if (!first->empty()) return pop(first); if (!second->empty()) |