mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 12:57:14 -05:00
Speed up reading of content file disabling mutexes
This commit is contained in:
parent
34ee2bf2a6
commit
b8b1d38781
4 changed files with 21 additions and 2 deletions
|
|
@ -765,6 +765,7 @@ struct snapraid_disk* disk_alloc(const char* name, const char* dir, uint64_t dev
|
|||
pathslash(disk->dir, sizeof(disk->dir));
|
||||
|
||||
#if HAVE_THREAD
|
||||
disk->single_thread = 0;
|
||||
thread_mutex_init(&disk->fs_mutex);
|
||||
#endif
|
||||
|
||||
|
|
@ -856,7 +857,8 @@ void extra_free(struct snapraid_extra* extra)
|
|||
static inline void fs_lock(struct snapraid_disk* disk)
|
||||
{
|
||||
#if HAVE_THREAD
|
||||
thread_mutex_lock(&disk->fs_mutex);
|
||||
if (!disk->single_thread)
|
||||
thread_mutex_lock(&disk->fs_mutex);
|
||||
#else
|
||||
(void)disk;
|
||||
#endif
|
||||
|
|
@ -865,7 +867,8 @@ static inline void fs_lock(struct snapraid_disk* disk)
|
|||
static inline void fs_unlock(struct snapraid_disk* disk)
|
||||
{
|
||||
#if HAVE_THREAD
|
||||
thread_mutex_unlock(&disk->fs_mutex);
|
||||
if (!disk->single_thread)
|
||||
thread_mutex_unlock(&disk->fs_mutex);
|
||||
#else
|
||||
(void)disk;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue