summaryrefslogtreecommitdiffstats
path: root/include/framework/scheduling/LockManager.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-03-03 16:49:43 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2025-03-03 16:49:43 -0500
commitdddb68e5479a047014f5eec4071fb8e96884354c (patch)
tree58634d9abe5d09406d541b69b83af4acb4f4a0b3 /include/framework/scheduling/LockManager.h
parent2ded45f5a20f38fdfd9f348c446c38dc713a5591 (diff)
downloaddynamic-extension-dddb68e5479a047014f5eec4071fb8e96884354c.tar.gz
LockManager.h: adjusted unlock procedure
There was a race condition. Now there isn't... or at least there's one less.
Diffstat (limited to 'include/framework/scheduling/LockManager.h')
-rw-r--r--include/framework/scheduling/LockManager.h3
1 files changed, 2 insertions, 1 deletions
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);
}
}