1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a lengthy write lock on the Recordings list in case of moving a folder with more than one recording

This commit is contained in:
Klaus Schmidinger 2017-12-05 16:44:21 +01:00
parent e5e0315d34
commit c868265397
3 changed files with 13 additions and 5 deletions

View File

@ -3286,6 +3286,8 @@ Matthias Senzel <matthias.senzel@t-online.de>
for reporting a crash when moving a recording between different volumes for reporting a crash when moving a recording between different volumes
for reporting a deadlock when moving a folder containing several recordings between for reporting a deadlock when moving a folder containing several recordings between
different volumes different volumes
for fixing a lengthy write lock on the Recordings list in case of moving a folder with
more than one recording
Marek Nazarko <mnazarko@gmail.com> Marek Nazarko <mnazarko@gmail.com>
for translating OSD texts to the Polish language for translating OSD texts to the Polish language

View File

@ -9162,7 +9162,7 @@ Video Disk Recorder Revision History
a subdirectory. a subdirectory.
- SVDRP peering can now be limited to the default SVDRP host (see MANUAL for details). - SVDRP peering can now be limited to the default SVDRP host (see MANUAL for details).
2017-12-04: Version 2.3.9 2017-12-05: Version 2.3.9
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
@ -9219,3 +9219,5 @@ Video Disk Recorder Revision History
menu, in case there is a LastReplayed recording. menu, in case there is a LastReplayed recording.
- The CAM menu is now automatically closed when the current channel is switched - The CAM menu is now automatically closed when the current channel is switched
(suggested by Dietmar Spingler). (suggested by Dietmar Spingler).
- Fixed a lengthy write lock on the Recordings list in case of moving a folder with
more than one recording (thanks to Matthias Senzel).

12
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 4.48 2017/12/04 15:25:57 kls Exp $ * $Id: menu.c 4.49 2017/12/05 16:39:57 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2479,11 +2479,15 @@ eOSState cMenuPathEdit::ApplyChanges(void)
cString NewPath = *folder ? cString::sprintf("%s%c%s", folder, FOLDERDELIMCHAR, name) : name; cString NewPath = *folder ? cString::sprintf("%s%c%s", folder, FOLDERDELIMCHAR, name) : name;
NewPath.CompactChars(FOLDERDELIMCHAR); NewPath.CompactChars(FOLDERDELIMCHAR);
if (strcmp(NewPath, path)) { if (strcmp(NewPath, path)) {
LOCK_RECORDINGS_WRITE; int NumRecordings = 0;
Recordings->SetExplicitModify(); {
int NumRecordings = Recordings->GetNumRecordingsInPath(path); LOCK_RECORDINGS_READ;
NumRecordings = Recordings->GetNumRecordingsInPath(path);
}
if (NumRecordings > 1 && !Interface->Confirm(cString::sprintf(tr("Move entire folder containing %d recordings?"), NumRecordings))) if (NumRecordings > 1 && !Interface->Confirm(cString::sprintf(tr("Move entire folder containing %d recordings?"), NumRecordings)))
return osContinue; return osContinue;
LOCK_RECORDINGS_WRITE;
Recordings->SetExplicitModify();
if (!Recordings->MoveRecordings(path, NewPath)) { if (!Recordings->MoveRecordings(path, NewPath)) {
Skins.Message(mtError, tr("Error while moving folder!")); Skins.Message(mtError, tr("Error while moving folder!"));
return osContinue; return osContinue;