hashmap: make sure to initialize shared hash key atomically

System Internals / systemd - Lennart Poettering [poettering.net] - 12 September 2020 07:33 UTC

if we allocate a bunch of hash tables all at the same time, with none earlier than the other, there's a good chance we'll initialize the shared hash key multiple times, so that some threads will see a different shared hash key than others.

Let's fix that, and make sure really everyone sees the same hash key.

Fixes: #17007

ae0b700a85 hashmap: make sure to initialize shared hash key atomically
src/basic/hashmap.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

Upstream: github.com


  • Share