basic: add _cleanup_ wrappers for pthread_mutex_{lock,unlock}
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 28 Mar 2020 12:24:44 +0000 (13:24 +0100)
committerMichael Biebl <biebl@debian.org>
Sun, 17 May 2020 17:28:49 +0000 (18:28 +0100)
commit933c0570f03067481c124a5e5ed83d8ab71dce2a
treeeb81a22ba65e7e20ffd7f0e1031ec9717316e635
parent783d46b1ea686209f58bb9ab755d455fd664e471
basic: add _cleanup_ wrappers for pthread_mutex_{lock,unlock}

I put the helper functions in a separate header file, because they don't fit
anywhere else. pthread_mutex_{lock,unlock} is used in two places: nss-systemd
and hashmap. I don't indent to convert hashmap to use the helpers, because
there it'd make the code more complicated. Is it worth to create a new header
file even if the only use is in nss-systemd.c? I think yes, because it feels
clean and also I think it's likely that pthread_mutex_{lock,unlock} will be
used in other places later.

(cherry picked from commit 29d4392ca05a31db53176f552041bb6183351d63)

Gbp-Pq: Name basic-add-_cleanup_-wrappers-for-pthread_mutex_-lock-unlo.patch
src/basic/meson.build
src/basic/pthread-util.h [new file with mode: 0644]