diff --git a/src/proc/control/proc-dispatcher.cpp b/src/proc/control/proc-dispatcher.cpp index 52d3b5be1..dc691abd2 100644 --- a/src/proc/control/proc-dispatcher.cpp +++ b/src/proc/control/proc-dispatcher.cpp @@ -33,12 +33,13 @@ //#include "proc/mobject/mobject.hpp" //#include "proc/mobject/placement.hpp" -//#include +#include //using boost::str; using backend::ThreadJoinable; using lib::Sync; using lib::RecursiveLock_Waitable; +using std::unique_ptr; namespace proc { namespace control { @@ -51,22 +52,27 @@ namespace control { bool canDispatch_{false}; bool blocked_ {false}; - SessionCommandService commandService_; + unique_ptr commandService_; public: DispatcherLoop (Subsys::SigTerm notification) : ThreadJoinable("Lumiera Session" , bind (&DispatcherLoop::run, this, notification)) - , commandService_(*this) + , commandService_(new SessionCommandService(*this)) { INFO (session, "Proc-Dispatcher running..."); } ~DispatcherLoop() { - this->join(); - INFO (session, "Proc-Dispatcher stopped."); + try { + Lock sync(this); + commandService_.reset(); + this->join(); + INFO (session, "Proc-Dispatcher stopped."); + } + ERROR_LOG_AND_IGNORE(session, "Stopping the Proc-Dispatcher"); } void diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 6cca8d71b..f78fbbb04 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -6371,12 +6371,18 @@ And last but not least: the difficult part of this whole concept is encapsulated {{red{WIP ... draft}}} -
+
//A subsystem within Proc-Layer, responsible for lifecycle and access to the editing [[Session]].//
 [img[Structure of the Session Subsystem|uml/Session-subsystem.png]]
 
 !Structure
-The ProcDispatcher is at the heart of the //Session Subsystem.// Because the official interface for working on the session, the {{{SessionCommand}}} façade, is expressed in terms of sending command messages to invoke predefined [[commands|CommandHandling]] to operate on the SessionInterface, the actual implementation of such a {{{SessionCommandService}}} needs a component actually to enqueue and dispatch those commands -- which is the {{{DispatcherLoop}}} within the ProcDispatcher. As usual, the ''lifecycle'' is controlled by a subsystem descriptor, which starts and stopps the whole subsystem; and this starting and stopping in turn translates into starting/stopping of the dispatcher loop. On the other hand, //activation of the dispatcher,// which means actively to dispatch commands, is controlled by the lifecycle of the session proper. The latter is just a data structure, and can be loaded / saved and rebuilt through the ''session manager''.
+The ProcDispatcher is at the heart of the //Session Subsystem.// Because the official interface for working on the session, the {{{SessionCommand}}} façade, is expressed in terms of sending command messages to invoke predefined [[commands|CommandHandling]] to operate on the SessionInterface, the actual implementation of such a {{{SessionCommandService}}} needs a component actually to enqueue and dispatch those commands -- which is the {{{DispatcherLoop}}} within the ProcDispatcher. As usual, the ''lifecycle'' is controlled by a subsystem descriptor, which starts and stopps the whole subsystem; and this starting and stopping in turn translates into starting/stopping of the dispatcher loop. On the other hand, //activation of the dispatcher,// which means actively to dispatch commands, is controlled by the lifecycle of the session proper. The latter is just a data structure, and can be loaded / saved and rebuilt through the ''session manager''. + +!Lifecycle + +!!!shutdown +Shutdown is initiated by sending a message to the dispatcher loop. {{red{TODO 12/2016}}} need to ensure the loop terminates reliably then! When loop terminates, the {{{sigTerm}}} of the SessionSubsystem is invoked, which then in turn causes the DispatcherLoop thread to be reaped. +
<<search>><<closeAll>><<permaview>><<newTiddler>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 9128bf5a1..c54fcc413 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -507,6 +507,30 @@ + + + + + + + +

+ muß SessionCommandService schließen +

+

+ bevor die Dispatcher-loop angehalten wird +

+ + +
+
+ + + + + + + @@ -10965,6 +10989,26 @@ + + + + + + + + + + + + + + + + + + + +