Update to ScalaSTM 0.5 (which includes Java API)

This commit is contained in:
Peter Vlugter 2012-02-06 11:34:47 +13:00
parent 59d6e93af4
commit 3fbd18f0fa
11 changed files with 27 additions and 346 deletions

View file

@ -7,14 +7,14 @@ package akka.docs.transactor;
//#class
import akka.transactor.*;
import scala.concurrent.stm.Ref;
import scala.concurrent.stm.japi.Stm;
import scala.concurrent.stm.japi.STM;
public class Counter extends UntypedTransactor {
Ref.View<Integer> count = Stm.newRef(0);
Ref.View<Integer> count = STM.newRef(0);
public void atomically(Object message) {
if (message instanceof Increment) {
Stm.increment(count, 1);
STM.increment(count, 1);
}
}