groostav
val temp = withLock { counter } val updated = temp + 1 withLock { counter = updated if(counter > 100) continueWorking = false } if (!continueWorking) return