CMutex.cpp

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2002 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #include "CMutex.h"
00016 #include "CArch.h"
00017 
00018 //
00019 // CMutex
00020 //
00021 
00022 CMutex::CMutex()
00023 {
00024     m_mutex = ARCH->newMutex();
00025 }
00026 
00027 CMutex::CMutex(const CMutex&)
00028 {
00029     m_mutex = ARCH->newMutex();
00030 }
00031 
00032 CMutex::~CMutex()
00033 {
00034     ARCH->closeMutex(m_mutex);
00035 }
00036 
00037 CMutex&
00038 CMutex::operator=(const CMutex&)
00039 {
00040     return *this;
00041 }
00042 
00043 void
00044 CMutex::lock() const
00045 {
00046     ARCH->lockMutex(m_mutex);
00047 }
00048 
00049 void
00050 CMutex::unlock() const
00051 {
00052     ARCH->unlockMutex(m_mutex);
00053 }

Generated on Fri Nov 6 00:18:45 2009 for synergy-plus by  doxygen 1.4.7