timeshift_filemgr: move the reaper lock to the end of loop to save the lock time
.... as suggested by Adam
This commit is contained in:
parent
d490918540
commit
dd6b47dcf8
1 changed files with 2 additions and 2 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue