[PATCH] D148728: [Support][Parallel] Add sequential mode to TaskGroup::spawn().

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 11:42:20 PDT 2023


andrewng added inline comments.


================
Comment at: llvm/lib/Support/Parallel.cpp:128-141
+      if (hasSequentialTasks()) {
+        SequentialQueueIsLocked = true;
+        auto Task = std::move(WorkQueueSequential.front());
+        WorkQueueSequential.pop();
+        Lock.unlock();
+        Task();
+        SequentialQueueIsLocked = false;
----------------
Not entirely sure this is better but does remove the code duplication.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148728/new/

https://reviews.llvm.org/D148728



More information about the llvm-commits mailing list