blob: c4aafd700e714d20bd8b21e9852c897fdfb45bba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*
* vdrlocks.h
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __VDRLOCKS_H
# define __VDRLOCKS_H
# ifdef VDR_PLUGIN
# include <vdr/config.h>
# include <vdr/tools.h>
/*
* It must always be done in the sequence:
* Timers -> Channels -> Recordings -> Schedules
*/
//***************************************************************************
// Timer List Lock Macros
//***************************************************************************
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
# define GET_TIMERS_READ(name) USE_LIST_LOCK_READ(Timers); \
const cTimers* name = Timers;
#else
# define GET_TIMERS_READ(name) cTimers* name = &Timers;
#endif
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
# define GET_TIMERS_WRITE(name) USE_LIST_LOCK_WRITE(Timers); \
cTimers* name = Timers;
#else
# define GET_TIMERS_WRITE(name) cTimers* name = &Timers;
#endif
//***************************************************************************
// Channel List Lock Macros
//***************************************************************************
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
# define GET_CHANNELS_READ(name) USE_LIST_LOCK_READ(Channels); \
const cChannels* name = Channels;
#else
# define GET_CHANNELS_READ(name) cChannels* name = &Channels;
#endif
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
# define GET_CHANNELS_WRITE(name) USE_LIST_LOCK_WRITE(Channels); \
cChannels* name = Channels;
#else
# define GET_CHANNELS_WRITE(name) cChannels* name = &Channels;
#endif
//***************************************************************************
// Recording List Lock Macros
//***************************************************************************
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
# define GET_RECORDINGS_READ(name) USE_LIST_LOCK_READ(Recordings); \
const cRecordings* name = Recordings;
#else
# define GET_RECORDINGS_READ(name) cRecordings* name = &Recordings;
#endif
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
# define GET_RECORDINGS_WRITE(name) USE_LIST_LOCK_WRITE(Recordings); \
cRecordings* name = Recordings;
#else
# define GET_RECORDINGS_WRITE(name) cRecordings* name = &Recordings;
#endif
//***************************************************************************
# endif // VDR_PLUGIN
#endif //___VDRLOCKS_H
|