Merge pull request #5798 from rocallahan/hashtable-destruction-race

Avoid racing accesses to shards[0] in ShardedHashtable parallel destruction
This commit is contained in:
Lofty 2026-04-11 10:25:58 +00:00 committed by GitHub
commit d51a5535c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -570,7 +570,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: