subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1134084 - /subversion/trunk/subversion/libsvn_wc/workqueue.c
Date Thu, 09 Jun 2011 21:17:29 GMT
Author: gstein
Date: Thu Jun  9 21:17:29 2011
New Revision: 1134084

URL: http://svn.apache.org/viewvc?rev=1134084&view=rev
Log:
After r1133773, we need to ensure the work item has been marked as
completed before we exit the loop (via cancellation). Technically, a work
item can be run multiple times, but let's not be gratuitous about it :-)

* subversion/libsvn_wc/workqueue.c:
  (svn_wc__wq_run): reorder the sequence of CANCEL_FUNC calling and work
    item fetching/completion. Leave ample comments so they maintain the
    same ordering with future changes.

Modified:
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1134084&r1=1134083&r2=1134084&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Thu Jun  9 21:17:29 2011
@@ -1512,18 +1512,24 @@ svn_wc__wq_run(svn_wc__db_t *db,
       apr_uint64_t id;
       svn_skel_t *work_item;
 
-      /* Stop work queue processing, if requested. A future 'svn cleanup'
-         should be able to continue the processing.  */
-      if (cancel_func)
-        SVN_ERR(cancel_func(cancel_baton));
-
       svn_pool_clear(iterpool);
 
+      /* Make sure to do this *early* in the loop iteration. There may
+         be a LAST_ID that needs to be marked as completed, *before* we
+         start worrying about anything else.  */
       SVN_ERR(svn_wc__db_wq_fetch_next(&id, &work_item, db, wri_abspath,
                                        last_id, iterpool, iterpool));
+
+      /* Stop work queue processing, if requested. A future 'svn cleanup'
+         should be able to continue the processing. Note that we may
+         have WORK_ITEM, but we'll just skip its processing for now.  */
+      if (cancel_func)
+        SVN_ERR(cancel_func(cancel_baton));
+
+      /* If we have a WORK_ITEM, then process the sucker. Otherwise,
+         we're done.  */
       if (work_item == NULL)
         break;
-
       SVN_ERR(dispatch_work_item(db, wri_abspath, work_item,
                                  cancel_func, cancel_baton, iterpool));
 



Mime
View raw message