This MR contains some fixups to !650 (merged) since @pschutze and me experienced issues with some modules when attempting do online monitoring, manifesting itself in seemingly random crashes deep within different parts of ROOT, changing whenever restarting.
This was traced back to be a threading issue, so this MR implements the following changes:
TApplication is created on the main thread - this removes the random crashes but leaves the spawned thread with an empty ROOT directory
gDirectory ti the spawned GUI thread and
cd()ing into it explicitly restores access to the histograms
gui_running is now a
std::atomic<bool> to be thread-safe
gui_ready atomic bool blocks the main thread
initialize() method until the GUI has been properly initialized. This removes possible race conditions between histogram creating/filling in other modules and the booking and access thereof from the GUI thread.
@aloeschc would you be so kind to look at this and test this since it touches your work?