summaryrefslogtreecommitdiffstats
path: root/include/framework/scheduling/FIFOScheduler.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-11-09 11:08:34 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2023-11-09 11:08:34 -0500
commit39d22316be1708073e4fe1f708814cc801ecdc69 (patch)
tree407467f24deac19f7d0c8b27f6d84785ee1e5b94 /include/framework/scheduling/FIFOScheduler.h
parent357cab549c2ed33970562b84ff6f83923742343d (diff)
downloaddynamic-extension-39d22316be1708073e4fe1f708814cc801ecdc69.tar.gz
Fixed various concurrency bugs
1. The system should now cleanly shutdown when the DynamicExtension object is destroyed. Before now, this would lead to use-after-frees and/or deadlocks. 2. Improved synchronization on mutable buffer structure management to fix the issue of the framework losing track of buffers during Epoch changeovers.
Diffstat (limited to 'include/framework/scheduling/FIFOScheduler.h')
-rw-r--r--include/framework/scheduling/FIFOScheduler.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/framework/scheduling/FIFOScheduler.h b/include/framework/scheduling/FIFOScheduler.h
index ba62f9e..4cdc436 100644
--- a/include/framework/scheduling/FIFOScheduler.h
+++ b/include/framework/scheduling/FIFOScheduler.h
@@ -47,9 +47,10 @@ public:
}
~FIFOScheduler() {
- shutdown();
+ if (!m_shutdown.load()) {
+ shutdown();
+ }
- m_cv.notify_all();
m_sched_thrd.join();
}
@@ -63,6 +64,8 @@ public:
void shutdown() {
m_shutdown.store(true);
+ m_thrd_pool.stop(true);
+ m_cv.notify_all();
}
private: