3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-04-14 16:25:12 +00:00

Avoid racing accesses to shards[0] in ShardedHashtable parallel destruction

This commit is contained in:
Robert O'Callahan 2026-04-08 21:56:36 +00:00
parent a96cf8cc2b
commit 1f6559a5cf

View file

@ -567,7 +567,7 @@ public:
// Call this for each shard to implement parallel destruction. For very large `ShardedHashtable`s,
// deleting all elements of all shards on a single thread can be a performance bottleneck.
void clear(const ThreadIndex &shard) {
AccumulatedValueEquality equality = shards[0].key_eq();
AccumulatedValueEquality equality = shards[shard.thread_num].key_eq();
shards[shard.thread_num] = Shard(0, AccumulatedValueHashOp(), equality);
}
private: