Skip to content

Commit

Permalink
attempt to wait up to 2 sec for cl.exe to finish writing a file! (why!?)
Browse files Browse the repository at this point in the history
  • Loading branch information
inorton committed Jan 30, 2014
1 parent 31a67ac commit 0c91f13
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CClash/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,18 +617,20 @@ public int InvokeCompiler(IEnumerable<string> args, Action<string> onStdErr, Act
if (!string.IsNullOrEmpty(ObjectTarget))
{
bool missing = true;
for (int i = 0; i < 10; i++)
var sw = new Stopwatch();
do
{
if (!FileUtils.Exists(ObjectTarget))
{
System.Threading.Thread.Sleep(200);
Logging.Emit("compiler slow to write object!");
System.Threading.Thread.Sleep(50);
}
else
{
missing = false;
break;
}
}
} while (missing && sw.ElapsedMilliseconds < 2000);

if (missing)
{
throw new CClashErrorException("compiler exited successfully but generated file '{0}' could not be not found", ObjectTarget);
Expand Down

0 comments on commit 0c91f13

Please sign in to comment.