You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2014/03/24 18:19:45 UTC
svn commit: r1580926 - /subversion/trunk/subversion/libsvn_subr/io.c
Author: julianfoad
Date: Mon Mar 24 17:19:44 2014
New Revision: 1580926
URL: http://svn.apache.org/r1580926
Log:
* subversion/svn/notify.c
(svn_io_sleep_for_timestamps): Revert r1580914, since Bert was unhappy
that it made the sleep longer (by the time taken for the stat) on average.
Modified:
subversion/trunk/subversion/libsvn_subr/io.c
Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1580926&r1=1580925&r2=1580926&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Mon Mar 24 17:19:44 2014
@@ -1280,6 +1280,11 @@ svn_io_sleep_for_timestamps(const char *
if (sleep_env_var && apr_strnatcasecmp(sleep_env_var, "yes") == 0)
return; /* Allow skipping for testing */
+ now = apr_time_now();
+
+ /* Calculate 0.02 seconds after the next second wallclock tick. */
+ then = apr_time_make(apr_time_sec(now) + 1, APR_USEC_PER_SEC / 50);
+
/* Worst case is waiting one second, so we can use that time to determine
if we can sleep shorter than that */
if (path)
@@ -1314,12 +1319,12 @@ svn_io_sleep_for_timestamps(const char *
return;
}
- }
- now = apr_time_now();
+ now = apr_time_now(); /* Extract the time used for the path stat */
- /* Calculate 0.02 seconds after the next second wallclock tick. */
- then = apr_time_make(apr_time_sec(now) + 1, APR_USEC_PER_SEC / 50);
+ if (now >= then)
+ return; /* Passing negative values may suspend indefinitely (Windows) */
+ }
apr_sleep(then - now);
}