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>
Sun, 20 Sep 2020 09:56:30 +0000 (11:56 +0200)
commit1557cfcf7ce1f2b9f2dbd28e1f9ee9fad606dec0
treeb88d8e38266d2f5e7d05de40102bce599c9f263f
parent0db378d852c03667360a94e2b2d6c5c0ab09b931
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)
(cherry picked from commit e662cf6d515daad19e70c3d85e244b213ac48997)
src/basic/hashmap.c