apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1790112 - /apr/apr/branches/1.6.x/locks/unix/misc.c
Date Tue, 04 Apr 2017 13:42:09 GMT
Author: jim
Date: Tue Apr  4 13:42:09 2017
New Revision: 1790112

URL: http://svn.apache.org/viewvc?rev=1790112&view=rev
Log:
backport r1790111

Modified:
    apr/apr/branches/1.6.x/locks/unix/misc.c

Modified: apr/apr/branches/1.6.x/locks/unix/misc.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/misc.c?rev=1790112&r1=1790111&r2=1790112&view=diff
==============================================================================
--- apr/apr/branches/1.6.x/locks/unix/misc.c (original)
+++ apr/apr/branches/1.6.x/locks/unix/misc.c Tue Apr  4 13:42:09 2017
@@ -50,6 +50,10 @@ int pthread_mutex_timedlock(pthread_mute
        remaining.tv_sec--;
        remaining.tv_nsec = (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec));
    }
+   /* If we had a REALLY small timeout ;) */
+   if (remaining.tv_sec < 0) {
+       return pthread_mutex_trylock(mutex);
+   }
    while ((rv = pthread_mutex_trylock(mutex)) == EBUSY) {
        ts.tv_sec = 0;
        ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : 



Mime
View raw message