mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Use debug mutex more
This commit is contained in:
parent
3f70e66ee3
commit
a2860c3f1f
26 changed files with 364 additions and 1156 deletions
|
|
@ -27,7 +27,6 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <time.h>
|
||||
|
||||
|
|
@ -42,7 +41,8 @@ typedef std::map<std::string,Element> statvfs_cache;
|
|||
|
||||
static uint64_t g_timeout = 0;
|
||||
static statvfs_cache g_cache;
|
||||
static pthread_mutex_t g_cache_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static Mutex g_cache_lock;
|
||||
|
||||
|
||||
static
|
||||
uint64_t
|
||||
|
|
@ -81,7 +81,7 @@ fs::statvfs_cache(const char *path_,
|
|||
rv = 0;
|
||||
now = ::_get_time();
|
||||
|
||||
mutex_lock(&g_cache_lock);
|
||||
mutex_lock(g_cache_lock);
|
||||
|
||||
e = &g_cache[path_];
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ fs::statvfs_cache(const char *path_,
|
|||
|
||||
*st_ = e->st;
|
||||
|
||||
mutex_unlock(&g_cache_lock);
|
||||
mutex_unlock(g_cache_lock);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue