From e4d56697ae1ca98971122251444ab058c060fb70 Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Tue, 6 Apr 2021 16:12:43 +0200 Subject: [PATCH] fixed missing noexcepts for task_queue --- include/gp/system/task_queue.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/gp/system/task_queue.hpp b/include/gp/system/task_queue.hpp index 8cd059d..241b88f 100644 --- a/include/gp/system/task_queue.hpp +++ b/include/gp/system/task_queue.hpp @@ -5,7 +5,6 @@ #include #include -// TODO: rename to task_queue and renamespace to gp::system (filename included) // TODO: noexcept everything namespace gp { @@ -18,14 +17,14 @@ namespace gp { alignas(gp_config::limits::hardware_constructive_interference_size) std::atomic next; - node() + node() noexcept { is_locked = false; value = nullptr; next = nullptr; } - node(node&& v) + node(node&& v) noexcept { v.try_acquire(); is_locked = false; @@ -46,7 +45,7 @@ namespace gp { using node_ptr = struct node*; using node_ptr_rep = std::atomic; - task_queue() + task_queue() noexcept : start{nullptr} , end{nullptr} {} @@ -55,7 +54,7 @@ namespace gp { node_ptr_rep end; // NODES ARE ACQUIRED ON POP - node_ptr try_pop() { + node_ptr try_pop() noexcept { auto ptr = start.load(); if(!ptr) return nullptr; @@ -78,7 +77,7 @@ namespace gp { // ONLY PUSH ACQUIRED NODES, // RELEASE WHEN NO LONGER IN USE - bool try_push(node_ptr node) { + bool try_push(node_ptr node) noexcept { node->next.store(nullptr); auto ed = end.load(); if(ed) {