#include <OSGLock.h>

Public Types | |
| typedef MPLockPoolType | Type |
Public Member Functions | |
Lock | |
| void | aquire (void *keyP) |
| void | release (void *keyP) |
| bool | request (void *keyP) |
Get | |
| virtual MPType & | getType (void) |
| virtual const MPType & | getType (void) const |
| UInt32 | getTypeId (void) |
| const Char8 * | getCName (void) const |
Reference Counting | |
| void | addRef (void) |
| void | subRef (void) |
| Int32 | getRefCount (void) |
Static Public Member Functions | |
Get | |
| static LockPool * | get (const Char8 *szName) |
| static LockPool * | find (const Char8 *szName) |
| static LockPool * | create (void) |
Class Get | |
| static const MPType & | getStaticType (void) |
| static UInt32 | getStaticTypeId (void) |
Protected Types | |
| typedef LockCommonBase | Inherited |
Protected Member Functions | |
Constructor | |
| LockPool (const Char8 *szName, UInt32 uiId) | |
Destructor | |
| virtual | ~LockPool (void) |
Construction | |
| bool | init (void) |
Destruction | |
| void | shutdown (void) |
Static Protected Member Functions | |
Create | |
| static LockPool * | create (const Char8 *szName, UInt32 uiId) |
Protected Attributes | |
| Lock | _pLocks [uiLockPoolSize] |
| UInt32 | _uiLockId |
Class Specific | |
| Char8 * | _szName |
Static Protected Attributes | |
| static MPLockPoolType | _type |
Private Member Functions | |
| LockPool (const LockPool &source) | |
| prohibit default function (move to 'public' if needed) | |
| void | operator= (const LockPool &source) |
| prohibit default function (move to 'public' if needed) | |
Friends | |
| class | MPFieldStore< LockPool > |
Definition at line 463 of file OSGLock.h.
| typedef MPLockPoolType osg::LockPool::Type |
typedef LockCommonBase osg::LockPool::Inherited [protected] |
Definition at line 572 of file OSGLock.cpp.
Referenced by create().
00573 : 00574 Inherited(szName, uiId) 00575 { 00576 }
| LockPool::~LockPool | ( | void | ) | [protected, virtual] |
Definition at line 580 of file OSGLock.cpp.
References osg::ThreadManager::removeLockPool(), shutdown(), and osg::ThreadManager::the().
00581 { 00582 ThreadManager::the()->removeLockPool(this); 00583 00584 shutdown(); 00585 }
| osg::LockPool::LockPool | ( | const LockPool & | source | ) | [private] |
Definition at line 513 of file OSGLock.cpp.
References osg::ThreadManager::getLockPool(), and osg::ThreadManager::the().
Referenced by create().
00514 { 00515 return ThreadManager::the()->getLockPool(szName, "OSGLockPool"); 00516 }
Definition at line 518 of file OSGLock.cpp.
References osg::ThreadManager::findLockPool(), and osg::ThreadManager::the().
00519 { 00520 return ThreadManager::the()->findLockPool(szName); 00521 }
| LockPool * LockPool::create | ( | void | ) | [static] |
Definition at line 523 of file OSGLock.cpp.
References get().
00524 { 00525 return LockPool::get(NULL); 00526 }
| void LockPool::aquire | ( | void * | keyP | ) |
Definition at line 534 of file OSGLock.cpp.
References _pLocks, and osg::uiLockPoolMask.
Referenced by osg::FieldContainerPtrBase::addRef(), and osg::FieldContainerPtrBase::subRef().
00535 { 00536 _pLocks[(UInt64(keyP) & uiLockPoolMask) >> 7].aquire(); 00537 }
| void LockPool::release | ( | void * | keyP | ) |
Definition at line 539 of file OSGLock.cpp.
References _pLocks, and osg::uiLockPoolMask.
Referenced by osg::FieldContainerPtrBase::addRef(), and osg::FieldContainerPtrBase::subRef().
00540 { 00541 _pLocks[(UInt64(keyP) & uiLockPoolMask) >> 7].release(); 00542 }
| bool LockPool::request | ( | void * | keyP | ) |
Definition at line 544 of file OSGLock.cpp.
References _pLocks, and osg::uiLockPoolMask.
00545 { 00546 return _pLocks[(UInt64(keyP) & uiLockPoolMask) >> 7].request(); 00547 }
Definition at line 555 of file OSGLock.cpp.
References init(), and LockPool().
00556 { 00557 LockPool *returnValue = NULL; 00558 00559 returnValue = new LockPool(szName, uiId); 00560 00561 if(returnValue->init() == false) 00562 { 00563 delete returnValue; 00564 returnValue = NULL; 00565 } 00566 00567 return returnValue; 00568 }
| bool LockPool::init | ( | void | ) | [protected] |
Definition at line 589 of file OSGLock.cpp.
References _pLocks, osg::MPBase::_szName, osg::PThreadLockBase::init(), osg::stringDup(), and osg::uiLockPoolSize.
Referenced by create().
00590 { 00591 bool returnValue = true; 00592 Char8 *pTmp; 00593 00594 pTmp = new Char8[strlen(_szName) + 6]; 00595 00596 for(UInt32 i = 0; i < uiLockPoolSize; i++) 00597 { 00598 #ifdef OSG_DEBUG_LOCK_STAT 00599 _pLockStats[i] = 0; 00600 #endif 00601 sprintf(pTmp, "%s%u\n", _szName, i); 00602 00603 stringDup(pTmp, _pLocks[i]._szName); 00604 00605 returnValue &= _pLocks[i].init(); 00606 } 00607 00608 delete [] pTmp; 00609 00610 return returnValue; 00611 }
| void LockPool::shutdown | ( | void | ) | [protected] |
Definition at line 615 of file OSGLock.cpp.
References _pLocks, osg::PThreadLockBase::shutdown(), and osg::uiLockPoolSize.
Referenced by ~LockPool().
00616 { 00617 for(UInt32 i = 0; i < uiLockPoolSize; i++) 00618 { 00619 _pLocks[i].shutdown(); 00620 } 00621 }
| void osg::LockPool::operator= | ( | const LockPool & | source | ) | [private] |
| 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] |
| 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().
| 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] |
Definition at line 64 of file OSGMemoryObject.cpp.
References osg::MemoryObject::_refCount.
Referenced by osg::SharedObjectHandler::getSharedObject(), and osg::SharedObjectHandler::initialize().
00065 { 00066 _refCount++; 00067 }
| void MemoryObject::subRef | ( | void | ) | [inherited] |
| Int32 MemoryObject::getRefCount | ( | void | ) | [inherited] |
Definition at line 77 of file OSGMemoryObject.cpp.
References osg::MemoryObject::_refCount.
00078 { 00079 return _refCount; 00080 }
friend class MPFieldStore< LockPool > [friend] |
MPLockPoolType LockPool::_type [static, protected] |
Lock osg::LockPool::_pLocks[uiLockPoolSize] [protected] |
UInt32 osg::LockCommonBase::_uiLockId [protected, inherited] |
Char8* osg::MPBase::_szName [protected, inherited] |
Definition at line 406 of file OSGMPBase.h.
Referenced by osg::MPBase::getCName(), init(), osg::MPBase::MPBase(), osg::BasePThreadBase::print(), and osg::MPBase::~MPBase().
1.5.5