When asking questions about concurency and race conditions it can be usefull to include an animated gif to demonstrate the problem: https://softwareengineering.stackexchange.com/questions/287999/start-a-service-when-the-first-client-connects-and-stopping-it-when-the-last-cli?noredirect=1#comment594766_287999 . Unfortunately, animations can be distracting to the reader or to the person who is trying to write a comment. It would be nice to add a "hide/show" or "show/hide" button for animated gifs so that the user could hide the animations when they were not looking at them.
There's already a feature that can be used.
The spoiler tag ">!" works on images too.
One can then just mouse over to see the image.
I've taken the liberty of adding them to your original post. You get big white blocks but they work just fine.