Line | |
---|
1 | /*
|
---|
2 | * synergy -- mouse and keyboard sharing utility
|
---|
3 | * Copyright (C) 2002 Chris Schoeneman
|
---|
4 | *
|
---|
5 | * This package is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU General Public License
|
---|
7 | * found in the file COPYING that should have accompanied this file.
|
---|
8 | *
|
---|
9 | * This package 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 |
|
---|
15 | #include "CMutex.h"
|
---|
16 | #include "CArch.h"
|
---|
17 |
|
---|
18 | //
|
---|
19 | // CMutex
|
---|
20 | //
|
---|
21 |
|
---|
22 | CMutex::CMutex()
|
---|
23 | {
|
---|
24 | m_mutex = ARCH->newMutex();
|
---|
25 | }
|
---|
26 |
|
---|
27 | CMutex::CMutex(const CMutex&)
|
---|
28 | {
|
---|
29 | m_mutex = ARCH->newMutex();
|
---|
30 | }
|
---|
31 |
|
---|
32 | CMutex::~CMutex()
|
---|
33 | {
|
---|
34 | ARCH->closeMutex(m_mutex);
|
---|
35 | }
|
---|
36 |
|
---|
37 | CMutex&
|
---|
38 | CMutex::operator=(const CMutex&)
|
---|
39 | {
|
---|
40 | return *this;
|
---|
41 | }
|
---|
42 |
|
---|
43 | void
|
---|
44 | CMutex::lock() const
|
---|
45 | {
|
---|
46 | ARCH->lockMutex(m_mutex);
|
---|
47 | }
|
---|
48 |
|
---|
49 | void
|
---|
50 | CMutex::unlock() const
|
---|
51 | {
|
---|
52 | ARCH->unlockMutex(m_mutex);
|
---|
53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.