Revision: 13945
          http://gate.svn.sourceforge.net/gate/?rev=13945&view=rev
Author:   valyt
Date:     2011-06-07 10:56:59 +0000 (Tue, 07 Jun 2011)

Log Message:
-----------
Replaced synchronisation around the interrupt-related methods with a volatile 
marker on the boolean interrupted flag (for efficiency reasons).

Modified Paths:
--------------
    gate/trunk/src/gate/creole/AbstractProcessingResource.java

Modified: gate/trunk/src/gate/creole/AbstractProcessingResource.java
===================================================================
--- gate/trunk/src/gate/creole/AbstractProcessingResource.java  2011-06-07 
10:49:56 UTC (rev 13944)
+++ gate/trunk/src/gate/creole/AbstractProcessingResource.java  2011-06-07 
10:56:59 UTC (rev 13945)
@@ -66,14 +66,14 @@
    * Checks whether this PR has been interrupted since the last time its
    * {@link #execute()} method was called.
    */
-  public synchronized boolean isInterrupted(){
+  public boolean isInterrupted(){
     return interrupted;
   }
 
   /**
    * Notifies this PR that it should stop its execution as soon as possible.
    */
-  public synchronized void interrupt(){
+  public void interrupt(){
     interrupted = true;
   }
 
@@ -210,5 +210,5 @@
    */
   private transient Vector progressListeners;
 
-  protected boolean interrupted = false;
+  protected volatile boolean interrupted = false;
 } // class AbstractProcessingResource


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
GATE-cvs mailing list
GATE-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to