You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2008/06/03 18:01:41 UTC
svn commit: r662831 -
/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
Author: schor
Date: Tue Jun 3 09:01:41 2008
New Revision: 662831
URL: http://svn.apache.org/viewvc?rev=662831&view=rev
Log:
[UIMA-1056] committed patch to fix synch issue found by findbugs
Modified:
incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java?rev=662831&r1=662830&r2=662831&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java Tue Jun 3 09:01:41 2008
@@ -195,7 +195,7 @@
}
private void notifyInitializationStatus(Exception e) {
- synchronized (this.InitializedState) {
+ synchronized (this) {
if (!this.InitializedState) {
this.InitializedStatus = e;
this.InitializedState = true;
@@ -575,12 +575,14 @@
// wait for connection handler threads to complete
t1.join();
t2.join();
-
- if (this.loggerConnection == null ||
- this.loggerHandler == null ||
- this.commandConnection == null) {
- throw new ResourceInitializationException(new IOException(
- "Could not establish socket connection with C++ service."));
+ synchronized(this)
+ {
+ if (this.loggerConnection == null ||
+ this.loggerHandler == null ||
+ this.commandConnection == null) {
+ throw new ResourceInitializationException(new IOException(
+ "Could not establish socket connection with C++ service."));
+ }
}
/* add the shutdown hook */
@@ -653,7 +655,10 @@
}
listeners.clear();
}
- loggerConnection.close();
+ synchronized(this)
+ {
+ loggerConnection.close();
+ }
commandConnection.close();
server.close();
}
@@ -775,7 +780,7 @@
}
public void addControllerCallbackListener(ControllerCallbackListener aListener) {
- synchronized (this.InitializedState) {
+ synchronized (this) {
this.listeners.add(aListener);
// if already initialized, notify now
if (this.InitializedState) {