]> granicus.if.org Git - clang/commitdiff
Seriously ugly hack to try to get the Windows builders back online
authorDouglas Gregor <dgregor@apple.com>
Wed, 5 Oct 2011 14:58:46 +0000 (14:58 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 5 Oct 2011 14:58:46 +0000 (14:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141180 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInstance.cpp

index 32455c9d57afcde6458aa4fb62d84482a4ad89ed..f14c2e30bc2305e5f8f3064aef47ac08b8bf30f9 100644 (file)
@@ -880,10 +880,13 @@ void LockFileManager::waitForUnlock() {
   if (getState() != LFS_Shared)
     return;
   
+#if LLVM_ON_WIN32
+  unsigned long Interval = 1;
+#else
   struct timespec Interval;
   Interval.tv_sec = 0;
   Interval.tv_nsec = 1000000;
-  
+#endif
   // Don't wait more than an hour for the file to appear.
   const unsigned MaxSeconds = 3600;
   do {
@@ -902,13 +905,23 @@ void LockFileManager::waitForUnlock() {
       return;
         
     // Exponentially increase the time we wait for the lock to be removed.
+#if LLVM_ON_WIN32
+    Interval *= 2;
+#else
     Interval.tv_sec *= 2;
     Interval.tv_nsec *= 2;
     if (Interval.tv_nsec >= 1000000000) {
       ++Interval.tv_sec;
       Interval.tv_nsec -= 1000000000;
     }
-  } while (Interval.tv_sec < MaxSeconds);
+#endif
+  } while (
+#if LLVM_ON_WIN32
+           Interval < MaxSeconds * 1000
+#else
+           Interval.tv_sec < MaxSeconds
+#endif
+           );
   
   // Give up.
 }