void (boolean resetState) { if (resetState) { mySuspendBackgroundTasksCounter.set(0); } else { if (mySuspendBackgroundTasksCounter.decrementAndGet() < 0) { mySuspendBackgroundTasksCounter.incrementAndGet(); } } }