• Rosen Penev's avatar
    treewide: replace lock_guard with scoped_lock · 4e0e4c00
    Rosen Penev authored
    SonarLint reports the latter to be better:
    
    std::scoped_lock basically provides the same feature as std::lock_guard,
    but is more generic: It can lock several mutexes at the same time, with a
    deadlock prevention mechanism (see {rule:cpp:S5524}). The equivalent code
    to perform simultaneous locking with std::lock_guard is significantly more
    complex. Therefore, it is simpler to use std::scoped_lock all the time,
    even when locking only one mutex (there will be no performance impact).
    Signed-off-by: 's avatarRosen Penev <rosenp@gmail.com>
    4e0e4c00
Name
Last commit
Last update
.github Loading commit data...
android Loading commit data...
build Loading commit data...
doc Loading commit data...
python/build Loading commit data...
src Loading commit data...
subprojects Loading commit data...
systemd Loading commit data...
test Loading commit data...
win32 Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
NEWS Loading commit data...
README.md Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...
mpd.svg Loading commit data...
valgrind.suppressions Loading commit data...