BREAKAGE: switching from se.scalablesolutions.akka to akka for all packages

This commit is contained in:
Viktor Klang 2010-10-26 12:49:25 +02:00
parent 29791593f0
commit 680ee7ddf1
393 changed files with 2100 additions and 2101 deletions

View file

@ -0,0 +1,26 @@
package akka.stm;
import akka.stm.Ref;
import akka.stm.local.Atomic;
public class CounterExample {
final static Ref<Integer> ref = new Ref<Integer>(0);
public static int counter() {
return new Atomic<Integer>() {
public Integer atomically() {
int inc = ref.get() + 1;
ref.set(inc);
return inc;
}
}.execute();
}
public static void main(String[] args) {
System.out.println();
System.out.println("Counter example");
System.out.println();
System.out.println("counter 1: " + counter());
System.out.println("counter 2: " + counter());
}
}