| 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 "CLock.h"
|
|---|
| 16 | #include "CCondVar.h"
|
|---|
| 17 | #include "CMutex.h"
|
|---|
| 18 |
|
|---|
| 19 | //
|
|---|
| 20 | // CLock
|
|---|
| 21 | //
|
|---|
| 22 |
|
|---|
| 23 | CLock::CLock(const CMutex* mutex) :
|
|---|
| 24 | m_mutex(mutex)
|
|---|
| 25 | {
|
|---|
| 26 | m_mutex->lock();
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | CLock::CLock(const CCondVarBase* cv) :
|
|---|
| 30 | m_mutex(cv->getMutex())
|
|---|
| 31 | {
|
|---|
| 32 | m_mutex->lock();
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | CLock::~CLock()
|
|---|
| 36 | {
|
|---|
| 37 | m_mutex->unlock();
|
|---|
| 38 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.