[PATCH] Add non-blocking Wait() for launched processes

Tareq A. Siraj tareq.a.siraj at intel.com
Fri Sep 20 12:36:33 PDT 2013


  @revane: Addressing review comments in next patch.
  @rnk: Thanks for the info about rL183864. I am kind of hesitant to call this class `Program` as opposed to `ProrcessInfo` since in this implementation, the `Execute...()` and `Wait()` functions are free functions and the only things the class stores is the Pid,  path to the prorgam and return code. Please let me know if you have other arguments in mind.

  Thanks.


================
Comment at: lib/Support/Program.cpp:63-66
@@ +62,6 @@
+    *ExecutionFailed = false;
+  if (!Execute(PI, Program, args, envp, redirects, memoryLimit, ErrMsg)) {
+    if (ExecutionFailed)
+      *ExecutionFailed = true;
+  }
+
----------------
Edwin Vane wrote:
> I'm not sure if the single-line flow control style thing applies here. There's only a single statement within the outer if...
Will remove.

================
Comment at: lib/Support/Unix/Program.inc:347
@@ -327,1 +346,3 @@
+  } else if (SecondsToWait == 0) {
+    WaitPidOptions = WNOHANG;
   }
----------------
Edwin Vane wrote:
> Single line if.
Will remove.

================
Comment at: lib/Support/Windows/Program.inc:403-404
@@ -386,3 +402,4 @@
     // -2 indicates a crash or timeout as opposed to failure to execute.
-    return -2;
+	WaitResult->ReturnCode = -2;
+    return WaitResult;
   }
----------------
Edwin Vane wrote:
> Looks like there might be a tab here. Indenting is off.
Fixed.


http://llvm-reviews.chandlerc.com/D1728



More information about the llvm-commits mailing list