From 5c7a92b3a400cbd2471060b83fdb23d6d2769937 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Mon, 29 Sep 2025 19:40:51 -0400 Subject: [PATCH] SerializedAsyncContin:getAcquiredQutexHistory returns rval ref This ensures that the caller takes ownership. --- include/serializedAsynchronousContinuation.h | 3 ++- smocore/serializedAsynchronousContinuation.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/serializedAsynchronousContinuation.h b/include/serializedAsynchronousContinuation.h index 6af0bc4..b0bcf4b 100644 --- a/include/serializedAsynchronousContinuation.h +++ b/include/serializedAsynchronousContinuation.h @@ -38,7 +38,8 @@ public: } // Return list of all qutexes in predecessors' LockSets; excludes self. - std::unique_ptr>> + [[nodiscard]] + std::unique_ptr>>&& getAcquiredQutexHistory() const; public: diff --git a/smocore/serializedAsynchronousContinuation.cpp b/smocore/serializedAsynchronousContinuation.cpp index 4d76bda..0b86094 100644 --- a/smocore/serializedAsynchronousContinuation.cpp +++ b/smocore/serializedAsynchronousContinuation.cpp @@ -182,7 +182,7 @@ SerializedAsynchronousContinuation #endif template -std::unique_ptr>> +std::unique_ptr>>&& SerializedAsynchronousContinuation::getAcquiredQutexHistory() const { @@ -213,7 +213,7 @@ const } } - return heldLocks; + return std::move(heldLocks); } // Explicit template instantiations for the types we need