From dd6b47dcf8c4d871bf4106aaf7d15fd0dd29e453 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 21 May 2014 14:25:00 +0200 Subject: [PATCH] timeshift_filemgr: move the reaper lock to the end of loop to save the lock time .... as suggested by Adam --- src/timeshift/timeshift_filemgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timeshift/timeshift_filemgr.c b/src/timeshift/timeshift_filemgr.c index d33be2810..19f19bb74 100644 --- a/src/timeshift/timeshift_filemgr.c +++ b/src/timeshift/timeshift_filemgr.c @@ -73,8 +73,6 @@ static void* timeshift_reaper_callback ( void *p ) tvhlog(LOG_ERR, "timeshift", "failed to remove %s [e=%s]", dpath, strerror(errno)); - pthread_mutex_lock(×hift_reaper_lock); - /* Free memory */ while ((ti = TAILQ_FIRST(&tsf->iframes))) { TAILQ_REMOVE(&tsf->iframes, ti, link); @@ -88,6 +86,8 @@ static void* timeshift_reaper_callback ( void *p ) } free(tsf->path); free(tsf); + + pthread_mutex_lock(×hift_reaper_lock); } pthread_mutex_unlock(×hift_reaper_lock); tvhtrace("timeshift", "reaper thread exit"); -- 2.47.2