Add debugging of mutexes (#1470)

When DEBUG defined it will used timed locks which will log when held
too long along with where.
This commit is contained in:
trapexit 2025-05-26 00:44:39 -05:00 • committed by GitHub
parent 4b751c2d37
commit 92312c8507
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 352 additions and 432 deletions

View file

@ -19,6 +19,8 @@
#include "fs_statvfs.hpp"
#include "statvfs_util.hpp"
#include "mutex.hpp"
#include <cstdint>
#include <map>
#include <string>
@ -82,7 +84,7 @@ namespace fs
rv = 0;
now = l::get_time();
pthread_mutex_lock(&g_cache_lock);
mutex_lock(&g_cache_lock);
e = &g_cache[path_];
@ -94,7 +96,7 @@ namespace fs
*st_ = e->st;
pthread_mutex_unlock(&g_cache_lock);
mutex_unlock(&g_cache_lock);
return rv;
}