mirror of https://github.com/YosysHQ/yosys.git
Avoid racing accesses to shards[0] in ShardedHashtable parallel destruction
This commit is contained in:
parent
a96cf8cc2b
commit
1f6559a5cf
|
|
@ -567,7 +567,7 @@ public:
|
||||||
// Call this for each shard to implement parallel destruction. For very large `ShardedHashtable`s,
|
// 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.
|
// deleting all elements of all shards on a single thread can be a performance bottleneck.
|
||||||
void clear(const ThreadIndex &shard) {
|
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);
|
shards[shard.thread_num] = Shard(0, AccumulatedValueHashOp(), equality);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue