[jboss-svn-commits] JBL Code SVN: r19411 - labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Apr 4 05:59:13 EDT 2008


Author: adinn
Date: 2008-04-04 05:59:13 -0400 (Fri, 04 Apr 2008)
New Revision: 19411

Modified:
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java
Log:
fixed error in recovery synchronization where monitor lock _stateLock was not notified when locked state _currentStatus was updated. recovery code now calls notifyAll() whenever setStatus() is called. fix for JBTM-346

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java	2008-04-04 05:47:38 UTC (rev 19410)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java	2008-04-04 09:59:13 UTC (rev 19411)
@@ -374,6 +374,8 @@
                                           FacilityCode.FAC_CRASH_RECOVERY, "PeriodicRecovery: background thread Status <== SCANNING" );
                            }
                            setStatus(Status.SCANNING);
+                           // must kick any other waiting threads
+                           _stateLock.notifyAll();
                            workToDo = true;
                            break;
                        case Mode.SUSPENDED:
@@ -413,6 +415,8 @@
                                   FacilityCode.FAC_CRASH_RECOVERY, "PeriodicRecovery: background thread Status <== INACTIVE");
                    }
                    setStatus(Status.INACTIVE);
+                   // must kick any other waiting threads
+                   _stateLock.notifyAll();
                    // check if we need to notify the listener worker that we just finsihsed  a scan
                    notifyWorker();
 
@@ -484,6 +488,8 @@
 
                     // ok grab our chance to start a scan
                     setStatus(Status.SCANNING);
+                    // must kick any other waiting threads
+                    _stateLock.notifyAll();
                     if (tsLogger.arjLogger.isDebugEnabled())
                     {
                         tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
@@ -512,6 +518,8 @@
                                FacilityCode.FAC_CRASH_RECOVERY, "PeriodicRecovery: ad hoc thread Status <== INACTIVE");
                 }
                 setStatus(Status.INACTIVE);
+                // must kick any other waiting threads
+                _stateLock.notifyAll();
                 // check if we need to notify the listener worker that we just finsihsed  a scan
                 notifyWorker();
             }




More information about the jboss-svn-commits mailing list