Synchronisation was on `entitiesToStopOnShutdown` at line 39. I'd suggest adding a new `private Object mutex` and synchronising everything on that, instead