[PATCH] D22742: Fix `-jobs=<N>` where <N> > 1 and the number of workers is > 1 on macOS.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 15:17:31 PDT 2016


delcypher marked 4 inline comments as done.

================
Comment at: lib/Fuzzer/FuzzerUtilDarwin.cpp:29
@@ +28,3 @@
+static struct sigaction OldSigQuitAction;
+static sigset_t OldBlockedSignalsSet;
+
----------------
Renamed `UseCount` to `ActiveThreadCount`.

================
Comment at: lib/Fuzzer/FuzzerUtilDarwin.cpp:41-48
@@ +40,10 @@
+    return -1;
+  // Block and ignore signals of the current process when the first thread
+  // enters.
+  {
+    std::lock_guard<std::mutex> Lock(SignalMutex);
+    if (ActiveThreadCount == 0) {
+      static struct sigaction IgnoreSignalAction;
+      sigset_t BlockedSignalsSet;
+      memset(&IgnoreSignalAction, 0, sizeof(IgnoreSignalAction));
+      IgnoreSignalAction.sa_handler = SIG_IGN;
----------------
I've moved most of them. I've not moved `SpawnAttributes` though because that would complicate the logic needs to restore the signal handlers when `posix_spawnattr_init()` fails.


https://reviews.llvm.org/D22742





More information about the llvm-commits mailing list