File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed
Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -82,9 +82,11 @@ namespace phlex::experimental {
8282 finalize ();
8383 run ();
8484 } catch (std::exception const & e) {
85+ driver_.stop ();
8586 spdlog::error (e.what ());
8687 throw ;
8788 } catch (...) {
89+ driver_.stop ();
8890 spdlog::error (" Unknown exception during graph execution" );
8991 throw ;
9092 }
Original file line number Diff line number Diff line change 22#define PHLEX_CORE_FWD_HPP
33
44#include " phlex/model/fwd.hpp"
5- #include " phlex/utilities/async_driver.hpp"
65
76#include < memory>
87
@@ -20,10 +19,6 @@ namespace phlex::experimental {
2019 using end_of_message_ptr = std::shared_ptr<end_of_message>;
2120}
2221
23- namespace phlex {
24- using framework_driver = experimental::async_driver<data_cell_index_ptr>;
25- }
26-
2722#endif // PHLEX_CORE_FWD_HPP
2823
2924// Local Variables:
Original file line number Diff line number Diff line change 66#include " phlex/configuration.hpp"
77#include " phlex/core/fwd.hpp"
88#include " phlex/model/product_store.hpp"
9+ #include " phlex/utilities/async_driver.hpp"
910
1011#include < concepts>
1112#include < memory>
1213
14+ namespace phlex {
15+ using framework_driver = experimental::async_driver<data_cell_index_ptr>;
16+ }
17+
1318namespace phlex ::experimental::detail {
1419
1520 // See note below.
Original file line number Diff line number Diff line change @@ -50,12 +50,19 @@ namespace phlex::experimental {
5050 return std::exchange (current_, std::nullopt );
5151 }
5252
53+ void stop ()
54+ {
55+ // API that should only be called by the framework_graph
56+ gear_ = states::park;
57+ cv_.notify_one ();
58+ }
59+
5360 void yield (RT rt)
5461 {
5562 std::unique_lock lock{mutex_};
5663 current_ = std::make_optional (std::move (rt));
5764 cv_.notify_one ();
58- cv_.wait (lock);
65+ cv_.wait (lock, [&] { return !current_. has_value () or gear_ == states::park; } );
5966 }
6067
6168 private:
You can’t perform that action at this time.
0 commit comments