summaryrefslogtreecommitdiffstats
path: root/include/framework/scheduling/LockManager.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-02-13 18:13:33 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2025-02-13 18:13:33 -0500
commitd28f2cfcd4249fc7d984762a326e3f2d6dcba7dc (patch)
treeea6fc7e80da2fec969c423ab50b42301397c9188 /include/framework/scheduling/LockManager.h
parent125e243cad99aa29444759e15053fd148ff0e3ba (diff)
downloaddynamic-extension-d28f2cfcd4249fc7d984762a326e3f2d6dcba7dc.tar.gz
progress towards resolving asynch structure merges
Diffstat (limited to 'include/framework/scheduling/LockManager.h')
-rw-r--r--include/framework/scheduling/LockManager.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/framework/scheduling/LockManager.h b/include/framework/scheduling/LockManager.h
index 91ed778..fcc79d1 100644
--- a/include/framework/scheduling/LockManager.h
+++ b/include/framework/scheduling/LockManager.h
@@ -46,7 +46,21 @@ public:
return false;
}
+ bool take_buffer_lock() {
+ bool old = m_buffer_lk.load();
+ if (!old) {
+ return m_buffer_lk.compare_exchange_strong(old, true);
+ }
+
+ return false;
+ }
+
+ void release_buffer_lock() {
+ m_buffer_lk.store(false);
+ }
+
private:
std::deque<std::atomic<bool>> m_lks;
+ std::atomic<bool> m_buffer_lk;
};
}