osg::Lock Class Reference
[Multithreading]

#include <OSGLock.h>

Inheritance diagram for osg::Lock:

osg::PThreadLockBase osg::LockCommonBase osg::MPBase osg::MemoryObject

List of all members.

Public Types

typedef MPLockType Type

Public Member Functions

Lock


void aquire (void)
void release (void)
bool request (void)
Get


virtual MPTypegetType (void)
virtual const MPTypegetType (void) const
UInt32 getTypeId (void)
const Char8getCName (void) const
Reference Counting


void addRef (void)
void subRef (void)
Int32 getRefCount (void)

Static Public Member Functions

Get


static Lockget (const Char8 *szName)
static Lockfind (const Char8 *szName)
static Lockcreate (void)
static const MPLockTypegetClassType (void)
Class Get


static const MPTypegetStaticType (void)
static UInt32 getStaticTypeId (void)

Protected Types

typedef PthreadLockBase Inherited

Protected Member Functions

Constructors


 Lock (void)
 Lock (const Char8 *szName, UInt32 uiId)
Destructor


virtual ~Lock (void)
Construction


bool init (void)
Destruction


void shutdown (void)

Static Protected Member Functions

Construction


static Lockcreate (const Char8 *szName, UInt32 uiId)

Protected Attributes

UInt32 _uiLockId
Class Specific


Char8_szName

Static Protected Attributes

static MPLockType _type

Private Member Functions

 Lock (const Lock &source)
 prohibit default function (move to 'public' if needed)
void operator= (const Lock &source)
 prohibit default function (move to 'public' if needed)

Friends

class LockPool
class MPFieldStore< Lock >


Detailed Description

Definition at line 381 of file OSGLock.h.


Member Typedef Documentation

Definition at line 387 of file OSGLock.h.

Reimplemented from osg::PThreadLockBase.

Definition at line 414 of file OSGLock.h.


Constructor & Destructor Documentation

Lock::Lock ( void   )  [protected]

Definition at line 483 of file OSGLock.cpp.

Referenced by create().

00483                :
00484     Inherited()
00485 {
00486 }

Lock::Lock ( const Char8 szName,
UInt32  uiId 
) [protected]

Definition at line 488 of file OSGLock.cpp.

00488                                            :
00489     Inherited(szName, uiId)
00490 {
00491 }

Lock::~Lock ( void   )  [protected, virtual]

Definition at line 495 of file OSGLock.cpp.

References osg::ThreadManager::removeLock(), osg::PThreadLockBase::shutdown(), and osg::ThreadManager::the().

00496 {
00497     ThreadManager::the()->removeLock(this);
00498 
00499     shutdown();
00500 }

osg::Lock::Lock ( const Lock source  )  [private]


Member Function Documentation

Lock * Lock::get ( const Char8 szName  )  [static]

Lock * Lock::find ( const Char8 szName  )  [static]

Definition at line 432 of file OSGLock.cpp.

References osg::ThreadManager::findLock(), and osg::ThreadManager::the().

00433 {
00434     return ThreadManager::the()->findLock(szName);
00435 }

Lock * Lock::create ( void   )  [static]

Definition at line 437 of file OSGLock.cpp.

References get().

00438 {
00439     return Lock::get(NULL);
00440 }

const MPLockType & Lock::getClassType ( void   )  [static]

Definition at line 442 of file OSGLock.cpp.

References _type.

Referenced by osg::ThreadManager::init().

00443 {
00444     return _type;
00445 }

void Lock::aquire ( void   ) 

Reimplemented from osg::PThreadLockBase.

Definition at line 449 of file OSGLock.cpp.

References osg::PThreadLockBase::aquire().

Referenced by osg::GroupMCastConnection::checkChannels(), osg::Window::GLObject::decRefCounter(), osg::GroupMCastConnection::disconnect(), osg::ThreadManager::findBarrier(), osg::ThreadManager::findLock(), osg::ThreadManager::findLockPool(), osg::ThreadManager::findThread(), osg::DgramQueue::get(), osg::ThreadManager::getBarrier(), osg::FieldContainerFactory::getContainer(), osg::ThreadManager::getLock(), osg::ThreadManager::getLockPool(), osg::ThreadManager::getThread(), osg::Window::GLObject::incRefCounter(), osg::FieldContainerFactory::initializePendingTypes(), osg::ProxyGroup::loadProc(), osg::PointMCastConnection::read(), osg::PointMCastConnection::readBuffer(), osg::PointMCastConnection::recvQueue(), osg::FieldContainerFactory::registerFieldContainer(), osg::FieldContainerFactory::registerGroup(), osg::FieldContainerFactory::registerType(), osg::ThreadManager::removeBarrier(), osg::ThreadManager::removeLock(), osg::ThreadManager::removeLockPool(), osg::ThreadManager::removeThread(), osg::PointMCastConnection::selectChannel(), osg::GroupMCastConnection::sendQueue(), osg::ProxyGroup::startLoading(), osg::Window::staticAcquire(), osg::FieldContainerFactory::unregisterFieldContainer(), osg::DgramQueue::wait(), osg::GroupMCastConnection::write(), osg::GroupMCastConnection::~GroupMCastConnection(), and osg::PointMCastConnection::~PointMCastConnection().

00450 {
00451     Inherited::aquire();
00452 }

void Lock::release ( void   ) 

Reimplemented from osg::PThreadLockBase.

Definition at line 454 of file OSGLock.cpp.

References osg::PThreadLockBase::release().

Referenced by osg::GroupMCastConnection::checkChannels(), osg::Window::GLObject::decRefCounter(), osg::GroupMCastConnection::disconnect(), osg::ThreadManager::findBarrier(), osg::ThreadManager::findLock(), osg::ThreadManager::findLockPool(), osg::ThreadManager::findThread(), osg::DgramQueue::get(), osg::ThreadManager::getBarrier(), osg::FieldContainerFactory::getContainer(), osg::ThreadManager::getLock(), osg::ThreadManager::getLockPool(), osg::ThreadManager::getThread(), osg::Window::GLObject::incRefCounter(), osg::FieldContainerFactory::initializePendingTypes(), osg::ProxyGroup::loadProc(), osg::PointMCastConnection::read(), osg::PointMCastConnection::readBuffer(), osg::PointMCastConnection::recvQueue(), osg::FieldContainerFactory::registerFieldContainer(), osg::FieldContainerFactory::registerGroup(), osg::FieldContainerFactory::registerType(), osg::ThreadManager::removeBarrier(), osg::ThreadManager::removeLock(), osg::ThreadManager::removeLockPool(), osg::ThreadManager::removeThread(), osg::PointMCastConnection::selectChannel(), osg::GroupMCastConnection::sendQueue(), osg::ProxyGroup::startLoading(), osg::Window::staticRelease(), osg::FieldContainerFactory::unregisterFieldContainer(), osg::DgramQueue::wait(), osg::GroupMCastConnection::write(), osg::GroupMCastConnection::~GroupMCastConnection(), and osg::PointMCastConnection::~PointMCastConnection().

00455 {
00456     Inherited::release();
00457 }

bool Lock::request ( void   ) 

Reimplemented from osg::PThreadLockBase.

Definition at line 459 of file OSGLock.cpp.

References osg::PThreadLockBase::request().

00460 {
00461     return Inherited::request();
00462 }

Lock * Lock::create ( const Char8 szName,
UInt32  uiId 
) [static, protected]

Definition at line 466 of file OSGLock.cpp.

References osg::PThreadLockBase::init(), and Lock().

00467 {
00468     Lock *returnValue = NULL;
00469 
00470     returnValue = new Lock(szName, uiId);
00471 
00472     if(returnValue->init() == false)
00473     {
00474         delete returnValue;
00475         returnValue = NULL;
00476     }
00477 
00478     return returnValue;
00479 }

void osg::Lock::operator= ( const Lock source  )  [private]

bool PThreadLockBase::init ( void   )  [protected, inherited]

Definition at line 115 of file OSGLock.cpp.

References osg::PThreadLockBase::_pLowLevelLock.

Referenced by create(), and osg::LockPool::init().

00116 {
00117     pthread_mutexattr_t lockAttr;
00118 
00119     pthread_mutexattr_init(&lockAttr);
00120 
00121     pthread_mutexattr_settype(&lockAttr, PTHREAD_MUTEX_RECURSIVE);
00122         
00123     pthread_mutex_init(&(_pLowLevelLock), &lockAttr);
00124 
00125     return true;
00126 }

void PThreadLockBase::shutdown ( void   )  [protected, inherited]

Definition at line 130 of file OSGLock.cpp.

References osg::PThreadLockBase::_pLowLevelLock.

Referenced by osg::LockPool::shutdown(), and ~Lock().

00131 {
00132     pthread_mutex_destroy(&(_pLowLevelLock));
00133 }

const MPType & MPBase::getStaticType ( void   )  [static, inherited]

Definition at line 253 of file OSGMPBase.cpp.

References osg::MPBase::_type.

00254 {
00255     return _type;
00256 }

UInt32 MPBase::getStaticTypeId ( void   )  [static, inherited]

Definition at line 259 of file OSGMPBase.cpp.

00260 {
00261     return 0;
00262 }

MPType & MPBase::getType ( void   )  [virtual, inherited]

Definition at line 265 of file OSGMPBase.cpp.

References osg::MPBase::_type.

Referenced by osg::MPBase::getTypeId().

00266 {
00267     return _type;
00268 }

const MPType & MPBase::getType ( void   )  const [virtual, inherited]

Definition at line 271 of file OSGMPBase.cpp.

References osg::MPBase::_type.

00272 {
00273     return _type;
00274 }

UInt32 MPBase::getTypeId ( void   )  [inherited]

Definition at line 277 of file OSGMPBase.cpp.

References osg::TypeBase::getId(), and osg::MPBase::getType().

00278 {
00279     return getType().getId();
00280 }

const Char8 * MPBase::getCName ( void   )  const [inherited]

Definition at line 283 of file OSGMPBase.cpp.

References osg::MPBase::_szName.

00284 {
00285     return _szName;
00286 }

void MemoryObject::addRef ( void   )  [inherited]

void MemoryObject::subRef ( void   )  [inherited]

Definition at line 69 of file OSGMemoryObject.cpp.

References osg::MemoryObject::_refCount.

00070 {
00071     _refCount--;
00072 
00073     if(_refCount <= 0)
00074         delete this;
00075 }

Int32 MemoryObject::getRefCount ( void   )  [inherited]

Definition at line 77 of file OSGMemoryObject.cpp.

References osg::MemoryObject::_refCount.

00078 {
00079     return _refCount;
00080 }


Friends And Related Function Documentation

friend class LockPool [friend]

Reimplemented from osg::PThreadLockBase.

Definition at line 444 of file OSGLock.h.

friend class MPFieldStore< Lock > [friend]

Definition at line 445 of file OSGLock.h.


Member Data Documentation

MPLockType Lock::_type [static, protected]

Reimplemented from osg::MPBase.

Definition at line 416 of file OSGLock.h.

Referenced by getClassType().

UInt32 osg::LockCommonBase::_uiLockId [protected, inherited]

Definition at line 92 of file OSGLock.h.

Char8* osg::MPBase::_szName [protected, inherited]


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

Generated on Mon Mar 17 12:03:14 2008 for OpenSG by  doxygen 1.5.5