Author: manik.surtani(a)jboss.com
Date: 2009-03-11 06:00:29 -0400 (Wed, 11 Mar 2009)
New Revision: 7897
Modified:
core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java
Log:
removed syncs on GTX
Modified: core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java 2009-03-10
21:24:47 UTC (rev 7896)
+++
core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java 2009-03-11
10:00:29 UTC (rev 7897)
@@ -27,6 +27,7 @@
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import java.util.concurrent.atomic.AtomicLong;
/**
@@ -42,7 +43,7 @@
private static final long serialVersionUID = 8011434781266976149L;
- private static long sid = 0;
+ private static AtomicLong sid = new AtomicLong(0);
private Address addr = null;
private long id = -1;
@@ -59,13 +60,9 @@
private GlobalTransaction(Address addr) {
this.addr = addr;
- id = newId();
+ id = sid.getAndIncrement();
}
- private static synchronized long newId() {
- return ++sid;
- }
-
public static GlobalTransaction create(Address addr) {
return new GlobalTransaction(addr);
}
Show replies by date