Skip to content

Commit 5f7361e

Browse files
committed
Try fixing ThreadPool issue
1 parent d16ca47 commit 5f7361e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@
7171
"variant": "cpp",
7272
"algorithm": "cpp",
7373
"*.inc": "cpp"
74-
}
74+
},
75+
"cmake.sourceDirectory": "/Users/akashlevy/Documents/preqorsor/third_party/yosys/abc"
7576
}

passes/techmap/abc.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2636,14 +2636,16 @@ struct AbcPass : public Pass {
26362636
ConcurrentQueue<std::unique_ptr<AbcModuleState>> work_queue(num_worker_threads);
26372637
ConcurrentQueue<std::unique_ptr<AbcModuleState>> work_finished_queue;
26382638
ConcurrentStack<AbcProcess> process_pool;
2639-
ThreadPool worker_threads(num_worker_threads, [&](int){
2639+
if (num_worker_threads > 0) {
2640+
ThreadPool worker_threads(num_worker_threads, [&](int){
26402641
while (std::optional<std::unique_ptr<AbcModuleState>> work =
26412642
work_queue.pop_front()) {
26422643
// Only the `run_abc` component is safe to touch here!
26432644
(*work)->run_abc.run(process_pool);
26442645
work_finished_queue.push_back(std::move(*work));
26452646
}
26462647
});
2648+
}
26472649
int state_index = 0;
26482650
int next_state_index_to_process = 0;
26492651
std::vector<std::unique_ptr<AbcModuleState>> work_finished_by_index;

0 commit comments

Comments
 (0)