hashmap: make sure to initialize shared hash key atomically
authorLennart Poettering <lennart@poettering.net>
Fri, 11 Sep 2020 22:09:07 +0000 (00:09 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 12 Sep 2020 12:16:19 +0000 (14:16 +0200)
commite662cf6d515daad19e70c3d85e244b213ac48997
treefa63b427b5d3363781b56531e6ba3490faeb0585
parentda310c6b45aa6ac360d2fc336eb164e401c08a86
hashmap: make sure to initialize shared hash key atomically

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
(cherry picked from commit ae0b700a856c0ae460d271bb50dccfaae84dbcab)
src/basic/hashmap.c