https://issues.apache.org/jira/browse/AMQ-3684 - revert initialisation order, thread can be eager and needs complete state so it must be inited last

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1243334 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2012-02-12 21:09:12 +00:00
parent bc8441bebc
commit 5a74d56cc1
1 changed files with 6 additions and 4 deletions

View File

@ -48,16 +48,18 @@ public class VMTransport implements Transport, Task {
protected final URI location;
protected final long id;
protected LinkedBlockingQueue<Object> messageQueue = new LinkedBlockingQueue<Object>(this.asyncQueueDepth);
private TaskRunner taskRunner = DefaultThreadPools.getDefaultTaskRunnerFactory().createTaskRunner(this, "VMTransport: " + toString());
private volatile int receiveCounter;
// Managed Sate access protected by locks.
protected final AtomicBoolean stopping = new AtomicBoolean();
protected final AtomicBoolean started = new AtomicBoolean();
protected final AtomicBoolean starting = new AtomicBoolean();
protected final AtomicBoolean disposed = new AtomicBoolean();
// thread can be eager, so initialisation needs to be last so that partial state is not visible
protected TaskRunner taskRunner = DefaultThreadPools.getDefaultTaskRunnerFactory().createTaskRunner(this, "VMTransport: " + toString());
private volatile int receiveCounter;
public VMTransport(URI location) {
this.location = location;
this.id = NEXT_ID.getAndIncrement();