From dddb68e5479a047014f5eec4071fb8e96884354c Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 3 Mar 2025 16:49:43 -0500 Subject: LockManager.h: adjusted unlock procedure There was a race condition. Now there isn't... or at least there's one less. --- include/framework/scheduling/LockManager.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/framework/scheduling/LockManager.h b/include/framework/scheduling/LockManager.h index 275c5ae..a40cf7a 100644 --- a/include/framework/scheduling/LockManager.h +++ b/include/framework/scheduling/LockManager.h @@ -27,12 +27,13 @@ public: void release_lock(size_t idx, size_t version) { if (idx < m_lks.size()) { assert(m_lks.at(idx).load() == true); - m_lks.at(idx).store(false); while (m_last_unlocked_version.load() < version) { auto tmp = m_last_unlocked_version.load(); m_last_unlocked_version.compare_exchange_strong(tmp, version); } + + m_lks.at(idx).store(false); } } -- cgit v1.2.3