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

Changed ##Lock to ##_Lock in the DEF_LIST_LOCK and USE_LIST_LOCK macros defined in tools.h

This commit is contained in:
Klaus Schmidinger 2017-06-11 09:01:47 +02:00
parent a4a3c63779
commit c70d62aeb4
3 changed files with 16 additions and 9 deletions

View File

@ -2835,6 +2835,8 @@ Johann Friedrichs <johann.friedrichs@web.de>
respective recording did not exist respective recording did not exist
for fixing a double deletion of a cTimer in case HandleRemoteModifications() returned for fixing a double deletion of a cTimer in case HandleRemoteModifications() returned
false false
for reporting an invalid lock sequence in the epgsearch plugin, which turned out to
be an abandoned member of class cSchedulesLock
Timo Helkio <timolavi@mbnet.fi> Timo Helkio <timolavi@mbnet.fi>
for reporting a hangup when replaying a TS recording with subtitles activated for reporting a hangup when replaying a TS recording with subtitles activated

View File

@ -9103,7 +9103,7 @@ Video Disk Recorder Revision History
- Fixed the locking sequence when switching between 'Now', 'Next' and 'Schedule' - Fixed the locking sequence when switching between 'Now', 'Next' and 'Schedule'
in the Schedules menu. in the Schedules menu.
2017-06-10: Version 2.3.7 2017-06-11: Version 2.3.7
- Fixed false positives when checking the locking sequence, in case of nested locks - Fixed false positives when checking the locking sequence, in case of nested locks
within the same thread. within the same thread.
@ -9121,3 +9121,8 @@ Video Disk Recorder Revision History
Martin Wache). Martin Wache).
- The "Channels" menu now indicates whether a channel is encrypted ('X') or a radio - The "Channels" menu now indicates whether a channel is encrypted ('X') or a radio
channel ('R') (thanks to Martin Wache). channel ('R') (thanks to Martin Wache).
- Changed ##Lock to ##_Lock in the DEF_LIST_LOCK and USE_LIST_LOCK macros defined
in tools.h, so that there is no cSchedulesLock any more. The epgsearch plugin still
had an abandoned member of class cSchedulesLock, which, as a side effect, caused an
invalid lock sequence to be flagged (reported by Johann Friedrichs). In order to
have the compiler report such things, these macros have been changed.

16
tools.h
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: tools.h 4.10 2017/05/22 20:21:08 kls Exp $ * $Id: tools.h 4.11 2017/06/11 08:52:06 kls Exp $
*/ */
#ifndef __TOOLS_H #ifndef __TOOLS_H
@ -614,19 +614,19 @@ public:
// is left: // is left:
#define DEF_LIST_LOCK2(Class, Name) \ #define DEF_LIST_LOCK2(Class, Name) \
class c##Name##Lock { \ class c##Name##_Lock { \
private: \ private: \
cStateKey stateKey; \ cStateKey stateKey; \
const c##Class *list; \ const c##Class *list; \
public: \ public: \
c##Name##Lock(bool Write = false) \ c##Name##_Lock(bool Write = false) \
{ \ { \
if (Write) \ if (Write) \
list = c##Class::Get##Name##Write(stateKey); \ list = c##Class::Get##Name##Write(stateKey); \
else \ else \
list = c##Class::Get##Name##Read(stateKey); \ list = c##Class::Get##Name##Read(stateKey); \
} \ } \
~c##Name##Lock() { if (list) stateKey.Remove(); } \ ~c##Name##_Lock() { if (list) stateKey.Remove(); } \
const c##Class *Name(void) const { return list; } \ const c##Class *Name(void) const { return list; } \
c##Class *Name(void) { return const_cast<c##Class *>(list); } \ c##Class *Name(void) { return const_cast<c##Class *>(list); } \
} }
@ -636,13 +636,13 @@ public: \
// a suitable DEF_LIST_LOCK, and also a pointer to the provided list: // a suitable DEF_LIST_LOCK, and also a pointer to the provided list:
#define USE_LIST_LOCK_READ2(Class, Name) \ #define USE_LIST_LOCK_READ2(Class, Name) \
c##Name##Lock Name##Lock(false); \ c##Name##_Lock Name##_Lock(false); \
const c##Class *Name __attribute__((unused)) = Name##Lock.Name(); const c##Class *Name __attribute__((unused)) = Name##_Lock.Name();
#define USE_LIST_LOCK_READ(Class) USE_LIST_LOCK_READ2(Class, Class) #define USE_LIST_LOCK_READ(Class) USE_LIST_LOCK_READ2(Class, Class)
#define USE_LIST_LOCK_WRITE2(Class, Name) \ #define USE_LIST_LOCK_WRITE2(Class, Name) \
c##Name##Lock Name##Lock(true); \ c##Name##_Lock Name##_Lock(true); \
c##Class *Name __attribute__((unused)) = Name##Lock.Name(); c##Class *Name __attribute__((unused)) = Name##_Lock.Name();
#define USE_LIST_LOCK_WRITE(Class) USE_LIST_LOCK_WRITE2(Class, Class) #define USE_LIST_LOCK_WRITE(Class) USE_LIST_LOCK_WRITE2(Class, Class)
template<class T> class cVector { template<class T> class cVector {