Update to ScalaSTM 0.5 (which includes Java API)
This commit is contained in:
parent
59d6e93af4
commit
3fbd18f0fa
11 changed files with 27 additions and 346 deletions
|
|
@ -8,10 +8,10 @@ package akka.docs.transactor;
|
|||
import akka.actor.*;
|
||||
import akka.transactor.*;
|
||||
import scala.concurrent.stm.Ref;
|
||||
import scala.concurrent.stm.japi.Stm;
|
||||
import scala.concurrent.stm.japi.STM;
|
||||
|
||||
public class CoordinatedCounter extends UntypedActor {
|
||||
private Ref.View<Integer> count = Stm.newRef(0);
|
||||
private Ref.View<Integer> count = STM.newRef(0);
|
||||
|
||||
public void onReceive(Object incoming) throws Exception {
|
||||
if (incoming instanceof Coordinated) {
|
||||
|
|
@ -24,7 +24,7 @@ public class CoordinatedCounter extends UntypedActor {
|
|||
}
|
||||
coordinated.atomic(new Runnable() {
|
||||
public void run() {
|
||||
Stm.increment(count, 1);
|
||||
STM.increment(count, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue