FeeServer::Mutex Class Reference
[Threading classes]

#include <feeserver/fee_lock.hh>

List of all members.


Detailed Description

Mutex lock.
Examples:

test_threads.cc.


Public Types

enum  Return {
  Success, BadMutex, DeadLock, Busy,
  Denied
}

Public Member Functions

 Mutex (const std::string &name="")
 Mutex (const std::string &name, const Attributes &attr)
virtual ~Mutex ()
Return Lock ()
Return TryLock ()
Return Unlock ()
const std::string & Name () const

Protected Member Functions

Return HandleReturn (const char *oper, int ret) const

Protected Attributes

pthread_mutex_t _mutex
std::string _name

Friends

class Condition

Classes

class  Attributes

Member Enumeration Documentation

Return codes

Enumerator:
Success 
BadMutex 
DeadLock 
Busy 
Denied 


Constructor & Destructor Documentation

FeeServer::Mutex::Mutex ( const std::string &  name = ""  ) 

Constructor

Parameters:
name Name of the mutex

FeeServer::Mutex::Mutex ( const std::string &  name,
const Attributes attr 
)

Constructor

Parameters:
name Name of the mutex
attr Attributes

FeeServer::Mutex::~Mutex (  )  [virtual]

Destructor


Member Function Documentation

FeeServer::Mutex::Return FeeServer::Mutex::Lock (  ) 

Lock the mutex. Can dead-lock calling thread if type is Fast, and the thread has already locked the mutex. If type is recursive, one must unlock the mutex as many times as it has been locked by a thread. The error checking will fail.

Returns:
false if the lock failed

FeeServer::Mutex::Return FeeServer::Mutex::TryLock (  ) 

Lock the mutex.

Returns:
false if the lock failed

FeeServer::Mutex::Return FeeServer::Mutex::Unlock (  ) 

Unlock the mutex.

Returns:
false if the lock failed

const std::string& FeeServer::Mutex::Name (  )  const [inline]

Get the name of the mutex

FeeServer::Mutex::Return FeeServer::Mutex::HandleReturn ( const char *  oper,
int  ret 
) const [protected]

Translate return values to our enum


Friends And Related Function Documentation

friend class Condition [friend]

Conditions are firends


Member Data Documentation

pthread_mutex_t FeeServer::Mutex::_mutex [protected]

std::string FeeServer::Mutex::_name [protected]

Name of mutex


The documentation for this class was generated from the following files:

Generated on Thu Jun 26 17:02:30 2008 for FeeServer++ 0.9 by  doxygen 1.5.6