Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonBlockingLongCounter.java')
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonBlockingLongCounter.java53
1 files changed, 0 insertions, 53 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonBlockingLongCounter.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonBlockingLongCounter.java
deleted file mode 100644
index 23a52ba2ec..0000000000
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonBlockingLongCounter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.util.concurrent;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * @author Eike Stepper
- */
-public final class NonBlockingLongCounter
-{
- private AtomicLong value;
-
- public NonBlockingLongCounter()
- {
- this(0L);
- }
-
- public NonBlockingLongCounter(long initialValue)
- {
- value = new AtomicLong(initialValue);
- }
-
- public long getValue()
- {
- return value.get();
- }
-
- public long increment()
- {
- long v;
- do
- {
- v = value.get();
- } while (!value.compareAndSet(v, v + 1));
-
- return v + 1;
- }
-
- @Override
- public String toString()
- {
- return Long.toString(getValue());
- }
-}

Back to the top