Mutex.h
Go to the documentation of this file.
//-----------------------------------------------------------------------------
//
// Mutex.h
//
// Cross-platform mutex
//
// Copyright (c) 2010 Mal Lansell <mal@lansell.org>
// All rights reserved.
//
// SOFTWARE NOTICE AND LICENSE
//
// This file is part of OpenZWave.
//
// OpenZWave is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// OpenZWave is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
#ifndef _Mutex_H
#define _Mutex_H
#include "platform/Wait.h"
namespace OpenZWave
{
class MutexImpl;
class Mutex: public Wait
{
public:
Mutex();
bool Lock( bool const _bWait = true );
void Unlock();
virtual bool IsSignalled();
protected:
~Mutex();
private:
Mutex( Mutex const& ); // prevent copy
Mutex& operator = ( Mutex const& ); // prevent assignment
MutexImpl* m_pImpl; // Pointer to an object that encapsulates the platform-specific implementation of a mutex.
};
} // namespace OpenZWave
#endif //_Mutex_H
OpenZWave
Definition: Bitfield.h:34
OpenZWave::Mutex::~Mutex
~Mutex()
Definition: Mutex.cpp:58
OpenZWave::Mutex::Unlock
void Unlock()
Definition: Mutex.cpp:81
Wait.h
OpenZWave::Mutex::Lock
bool Lock(bool const _bWait=true)
Definition: Mutex.cpp:69
OpenZWave::Wait
Platform-independent definition of Wait objects.
Definition: Wait.h:41
OpenZWave::Mutex
Implements a platform-independent mutex–for serializing access to a shared resource.
Definition: Mutex.h:39
OpenZWave::Mutex::IsSignalled
virtual bool IsSignalled()
Definition: Mutex.cpp:98
OpenZWave::Mutex::Mutex
Mutex()
Definition: Mutex.cpp:47
OpenZWave::MutexImpl
Windows-specific implementation of the Mutex class.
Definition: windows/MutexImpl.h:38