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 2007/02/08 23:30:53 UTC

svn commit: r505065 - /incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java

Author: schor
Date: Thu Feb  8 14:30:53 2007
New Revision: 505065

URL: http://svn.apache.org/viewvc?view=rev&rev=505065
Log:
UIMA-284 lock was renamed

Modified:
    incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java?view=diff&rev=505065&r1=505064&r2=505065
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java Thu Feb  8 14:30:53 2007
@@ -507,28 +507,28 @@
    * 
    */
   private void isCpmPaused() {
-    // Pause this thread if CPM has been paused
-    if (cpm.isPaused()) {
-      threadState = 2016;
-      if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-        UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
-                "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_pausing_pp__FINEST",
-                new Object[] { Thread.currentThread().getName() });
-      }
-      synchronized (cpm.monitor) {
+    synchronized (cpm.lockForPause) {
+      // Pause this thread if CPM has been paused
+      while (cpm.isPaused()) {
+        threadState = 2016;
+        if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+          UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+                  "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_pausing_pp__FINEST",
+                  new Object[] { Thread.currentThread().getName() });
+        }
+
         try {
           // Wait until resumed
-          cpm.monitor.wait();
-        } catch (Exception e) {
+          cpm.lockForPause.wait();
+        } catch (InterruptedException e) {
+        }
+        if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+          UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+                  "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_resuming_pp__FINEST",
+                  new Object[] { Thread.currentThread().getName() });
         }
-      }
-      if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-        UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
-                "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_resuming_pp__FINEST",
-                new Object[] { Thread.currentThread().getName() });
       }
     }
-
   }
 
   /**