MutexSemaphore.hpp
#if !defined(__MUTEXSEMAPHORE_HPP)
#define __MUTEXSEMAPHORE_HPP
/*
CoreLinux++
Copyright (C) 1999,2000 CoreLinux Consortium
The CoreLinux++ Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The CoreLinux++ Library Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined(__COMMON_HPP)
#include <Common.hpp>
#endif
#if !defined(__SEMAPHORE_HPP)
#include <Semaphore.hpp>
#endif
namespace corelinux
{
DECLARE_CLASS( MutexSemaphore );
class MutexSemaphore : public Semaphore
{
public:
//
// Constructors and destructors
//
MutexSemaphore
(
SemaphoreGroupPtr,
SemaphoreIdentifierRef,
bool AutoLock = false,
bool Recursive = true,
bool Balking = false
) throw ( NullPointerException );
virtual ~MutexSemaphore( void );
//
// Accessors
//
virtual bool isLocked( void ) ;
//
// Mutators
//
virtual SemaphoreOperationStatus lockWithWait( void )
throw(SemaphoreException);
virtual SemaphoreOperationStatus lockWithNoWait( void )
throw(SemaphoreException);
// virtual SemaphoreOperationStatus lockWithTimeOut( Timer )
// throw(SemaphoreException) = 0;
virtual SemaphoreOperationStatus release( void )
throw(SemaphoreException);
protected:
//
// Constructors
//
MutexSemaphore( void ) throw( Assertion );
MutexSemaphore( MutexSemaphoreCref )
throw( Assertion );
//
// Operator overloads
//
MutexSemaphoreRef operator=( MutexSemaphoreCref )
throw( Assertion );
private:
};
}
#endif // if !defined(__MUTEXSEMAPHORE_HPP)
/*
Common rcs information do not modify
$Author: frankc $
$Revision: 1.2 $
$Date: 2000/06/02 11:51:52 $
$Locker: $
*/
corelinux::MutexSemaphore::lockWithWait
virtual SemaphoreOperationStatus lockWithWait(void)
Request the semaphore, wait for availability.
Definition: MutexSemaphore.cpp:108
corelinux::MutexSemaphore
MutexSemaphore implements a mutual exclusion control which can be used to insure that at most one (1)...
Definition: MutexSemaphore.hpp:51
corelinux::MutexSemaphore::isLocked
virtual bool isLocked(void)
Ask if semaphore instance is locked.
Definition: MutexSemaphore.cpp:99
corelinux::SemaphoreOperationStatus
SemaphoreOperationStatus
Semaphore method return enumeration.
Definition: AbstractSemaphore.hpp:39
corelinux::NullPointerException
NullPointerException is the base exception type for NullPointer.
Definition: NullPointerException.hpp:40
corelinux::ScalarIdentifier
ScalarIdentifier provides a templated interface for declaring CoreLinux Identifiers for simple scalar...
Definition: ScalarIdentifiers.hpp:37
corelinux::MutexSemaphore::MutexSemaphore
MutexSemaphore(void)
Default construct throws assert.
Definition: MutexSemaphore.cpp:39
corelinux::SemaphoreException
SemaphoreException is the base exception type for Semaphore.
Definition: SemaphoreException.hpp:39
corelinux::Semaphore
A Semaphore supports the protocol that processes and/or threads agree to follow for the purpose of co...
Definition: Semaphore.hpp:61
corelinux::Assertion
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
corelinux::MutexSemaphore::~MutexSemaphore
virtual ~MutexSemaphore(void)
Virtual Destructor.
Definition: MutexSemaphore.cpp:90
corelinux::MutexSemaphore::lockWithNoWait
virtual SemaphoreOperationStatus lockWithNoWait(void)
Request the semaphore without waiting.
Definition: MutexSemaphore.cpp:190
corelinux::MutexSemaphore::operator=
MutexSemaphoreRef operator=(MutexSemaphoreCref)
Assignment operator throws assertion.
corelinux::MutexSemaphore::release
virtual SemaphoreOperationStatus release(void)
Request the semaphore but timeout if not available.
Definition: MutexSemaphore.cpp:256
corelinux::SemaphoreGroup
A SemaphoreGroup is an extension to the Linux semaphore set.
Definition: SemaphoreGroup.hpp:62

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium