BREAKAGE: switching from se.scalablesolutions.akka to akka for all packages
This commit is contained in:
parent
29791593f0
commit
680ee7ddf1
393 changed files with 2100 additions and 2101 deletions
26
akka-actor/src/test/java/akka/stm/CounterExample.java
Normal file
26
akka-actor/src/test/java/akka/stm/CounterExample.java
Normal 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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue