diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2025-03-03 16:49:43 -0500 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2025-03-03 16:49:43 -0500 |
| commit | dddb68e5479a047014f5eec4071fb8e96884354c (patch) | |
| tree | 58634d9abe5d09406d541b69b83af4acb4f4a0b3 /include/framework/scheduling/LockManager.h | |
| parent | 2ded45f5a20f38fdfd9f348c446c38dc713a5591 (diff) | |
| download | dynamic-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.h | 3 |
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); } } |