We moved initializeSalmanoff and shutdownSalmanoff into
salmanoff.cpp. Now we also invoke shutdownSalmanoff when exiting
to destroy subsystems and components gracefully.
This fixes the segfault that was thrown on every program exit
when xcbWindow had captured a window.
Mrntt now has the event loop structure required to orderly shut itself
down when it itself generates an exception. We can now post a message
within the catch{} blocks for Mrntt's event loop, telling Mrntt
to shut down the Mind threads and then shut itself down.
We also split the code to initialize threads etc out of mrntt and
put it into the Mind:: namespace.
This commit significantly restructures the way we setup threading in
SMO. We now don't use the CRT main() thread at all. It's only used
as a mechanism to ensure that Marionette doesn't execute before
global constructors have been executed.
JOLTing:
This is a simple ASIO post()ed message that makes each thread setup
its thread-local data pointer to its own ComponentThread object,
and then enter its main ASIO run() loop to await commands from
Marionette.
Exception bubbling:
We now cleanly cause mind threads to report their exceptions
to marionette, so that marionette can cleanly shut the mind down
in an orderly fashion.
Thread Control messaging API:
A namespace of asynchronous messages to be post()ed to threads to
control them. It enables us to pause and resume threads. This will
be very useful for Marionette when we add the ability for it to
suspend Salmanoff's running mind, inject new goals, inspect current
state, etc; and then resume the mind's execution.
xcbXorg is a connection manager lib that'll be used in common by all of
the xcb API frontends: xcbMouse, xcbWindow and xcbKeyboard. We moved
it into commonLibs to make it make more sense.
We also cleaned up the M4 scripting around AC_ARG_VAR-ing new common
libs as well as sense/wilzor libs.
* We had a prior issue where EQUALS would require that there be no
whitespace between itself and its operands on either side. We got
a bad solution from ChatGPT 4o. We got a proper solution now from
o1.
* Previously, if a string ended with a backslash right before EOF, the
backslash would be included. Now it will be dropped.
* Merge the two regexes for ignoring whitespace into one.
We add 2 new threads for handling the interoceptors and extrospector
events. Also add comments explaining the purpose and role of each of
these major threads.