CPPMyth
Library to interoperate with MythTV server
Loading...
Searching...
No Matches
mythlocked.cpp
1
/*
2
* Copyright (C) 2015 Jean-Luc Barriere
3
*
4
* This Program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2, or (at your option)
7
* any later version.
8
*
9
* This Program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; see the file COPYING. If not, write to
16
* the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
17
* MA 02110-1301 USA
18
* http://www.gnu.org/copyleft/gpl.html
19
*
20
*/
21
22
#include "mythlocked.h"
23
#include "private/os/threads/latch.h"
24
25
// Compatibility with C++98 remains
26
27
using namespace
Myth
;
28
29
Lockable::Lockable()
30
: m_lock(new OS::Latch()) { }
31
32
Lockable::~Lockable()
33
{
34
delete
m_lock;
35
}
36
37
void
Lockable::Lock
()
38
{
39
m_lock->lock();
40
}
41
42
void
Lockable::Unlock
()
43
{
44
m_lock->unlock();
45
}
46
47
void
Lockable::LockShared
()
48
{
49
m_lock->lock_shared();
50
}
51
52
void
Lockable::UnlockShared
()
53
{
54
m_lock->unlock_shared();
55
}
Myth::Lockable::Unlock
void Unlock()
Definition
mythlocked.cpp:42
Myth::Lockable::Lock
void Lock()
Definition
mythlocked.cpp:37
Myth::Lockable::UnlockShared
void UnlockShared()
Definition
mythlocked.cpp:52
Myth::Lockable::LockShared
void LockShared()
Definition
mythlocked.cpp:47
Myth
This is the main namespace that encloses all public classes.
Definition
mythcontrol.h:30
cppmyth
src
mythlocked.cpp
Generated on
for CPPMyth by
1.15.0