incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r919441 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
Date Fri, 05 Mar 2010 15:06:34 GMT
Author: cziegeler
Date: Fri Mar  5 15:06:34 2010
New Revision: 919441

URL: http://svn.apache.org/viewvc?rev=919441&view=rev
Log:
SLING-1426 : Spurious wakeups are not handled correctly

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java?rev=919441&r1=919440&r2=919441&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
Fri Mar  5 15:06:34 2010
@@ -696,17 +696,17 @@
                 info = null;
                 if ( jobQueue.isOrdered() ) {
                     // if we are ordered we simply wait for the finish
-                    synchronized ( jobQueue.getLock()) {
-                        final Status status = this.executeJob(processInfo, jobQueue);
-                        if ( status == Status.SUCCESS ) {
+                    final Status status = this.executeJob(processInfo, jobQueue);
+                    if ( status == Status.SUCCESS ) {
+                        synchronized ( jobQueue.getLock()) {
                             try {
                                 info = jobQueue.waitForFinish();
                             } catch (InterruptedException e) {
                                 this.ignoreException(e);
                             }
-                        } else if ( status == Status.RESCHEDULE ) {
-                            info = jobQueue.reschedule(processInfo, this.scheduler);
                         }
+                    } else if ( status == Status.RESCHEDULE ) {
+                        info = jobQueue.reschedule(processInfo, this.scheduler);
                     }
                 } else {
                     final int maxJobs = ParallelInfo.getMaxNumberOfParallelJobs(processInfo.event);



Mime
View raw message