Solved multi-threading issue where awaiting consumers to stop would result in application freeze