Make miscellaneous variables thread-safe

This commit is contained in:
ridiculousfish
2019-04-28 15:56:49 -07:00
parent 6e143bf50f
commit fe68287cb0
3 changed files with 26 additions and 36 deletions

View File

@@ -1261,8 +1261,8 @@ bool completer_t::try_complete_user(const wcstring &str) {
bool result = false;
size_t name_len = str.length() - 1;
static std::mutex lock;
scoped_lock locker(lock);
static std::mutex s_setpwent_lock;
scoped_lock locker(s_setpwent_lock);
setpwent();
// cppcheck-suppress getpwentCalled
while (struct passwd *pw = getpwent()) {