#include <OSGBarrier.h>
Inheritance diagram for osg::PThreadBarrierBase:

Class Specific | |
| Char8 * | _szName |
| *static MPType | _type |
Protected Types | |
| typedef BarrierCommonBase | Inherited |
Protected Member Functions | |
Constructors | |
| * | PThreadBarrierBase (const Char8 *szName, UInt32 uiId) |
Destructor | |
| *virtual | ~PThreadBarrierBase (void) |
Construction | |
| *bool | init (void) |
Destruction | |
| *void | shutdown (void) |
Enter | |
| *void | enter (void) |
| void | enter (UInt32 uiNumWaitFor) |
Set | |
| *void | setNumWaitFor (UInt32 uiNumWaitFor) |
Protected Attributes | |
| UInt32 | _uiBarrierId |
| volatile UInt32 | _uiNumWaitFor |
Private Member Functions | |
| PThreadBarrierBase (const PThreadBarrierBase &source) | |
| prohibit default function (move to 'public' if needed) | |
| void | operator= (const PThreadBarrierBase &source) |
| prohibit default function (move to 'public' if needed) | |
Private Attributes | |
| pthread_mutex_t | _pLockOne |
| pthread_cond_t | _pWakeupCondition [2] |
| UInt32 | _uiCount |
| UInt32 | _uiCurrentCond |
Definition at line 131 of file OSGBarrier.h.
|
|
Reimplemented from osg::BarrierCommonBase. Reimplemented in osg::Barrier. Definition at line 141 of file OSGBarrier.h. |
|
||||||||||||
|
Definition at line 86 of file OSGBarrier.cpp. 00087 : 00088 Inherited (szName, 00089 uiId ), 00090 00091 _pLockOne ( ), 00092 _uiCount (0 ), 00093 _uiCurrentCond (0 ) 00094 { 00095 }
|
|
|
Definition at line 99 of file OSGBarrier.cpp.
|
|
|
|
|
|
Definition at line 105 of file OSGBarrier.cpp. References _pLockOne, _pWakeupCondition, _uiCount, and _uiCurrentCond. Referenced by osg::Barrier::create(). 00106 { 00107 pthread_cond_init (&(_pWakeupCondition[0]), NULL); 00108 pthread_cond_init (&(_pWakeupCondition[1]), NULL); 00109 pthread_mutex_init(&(_pLockOne), NULL); 00110 00111 _uiCount = 0; 00112 _uiCurrentCond = 0; 00113 00114 return true; 00115 }
|
|
|
Definition at line 119 of file OSGBarrier.cpp. References _pLockOne, and _pWakeupCondition. Referenced by osg::Barrier::~Barrier(). 00120 { 00121 pthread_cond_destroy (&(_pWakeupCondition[0])); 00122 pthread_cond_destroy (&(_pWakeupCondition[1])); 00123 pthread_mutex_destroy(&(_pLockOne)); 00124 }
|
|
|
Reimplemented in osg::Barrier. Definition at line 53 of file OSGBarrier.inl. References _pLockOne, _pWakeupCondition, _uiCount, _uiCurrentCond, and osg::BarrierCommonBase::_uiNumWaitFor. Referenced by osg::Barrier::enter(), and enter(). 00054 { 00055 if(_uiNumWaitFor <= 1) 00056 return; 00057 00058 pthread_mutex_lock(&(_pLockOne)); 00059 00060 _uiCount++; 00061 00062 if(_uiCount < _uiNumWaitFor) 00063 { 00064 /* not enough threads are waiting => wait */ 00065 00066 pthread_cond_wait(&(_pWakeupCondition[_uiCurrentCond]), &(_pLockOne)); 00067 } 00068 else 00069 { 00070 /* ok, enough threads are waiting 00071 => wake up all waiting threads 00072 */ 00073 00074 pthread_cond_broadcast(&(_pWakeupCondition[_uiCurrentCond])); 00075 00076 _uiCount = 0; 00077 _uiCurrentCond = 1 - _uiCurrentCond; 00078 } 00079 00080 pthread_mutex_unlock(&(_pLockOne)); 00081 }
|
|
|
Reimplemented in osg::Barrier. Definition at line 84 of file OSGBarrier.inl. References osg::BarrierCommonBase::_uiNumWaitFor, and enter(). 00085 { 00086 _uiNumWaitFor = uiNumWaitFor; 00087 00088 enter(); 00089 }
|
|
|
|
|
|
Definition at line 42 of file OSGBarrier.inl. References osg::BarrierCommonBase::_uiNumWaitFor. 00043 { 00044 _uiNumWaitFor = uiNumWaitFor; 00045 }
|
|
|
Definition at line 253 of file OSGMPBase.cpp. References osg::MPBase::_type. 00254 { 00255 return _type; 00256 }
|
|
|
Definition at line 259 of file OSGMPBase.cpp.
|
|
|
Definition at line 265 of file OSGMPBase.cpp. References osg::MPBase::_type. Referenced by osg::MPBase::getTypeId(). 00266 { 00267 return _type; 00268 }
|
|
|
Definition at line 271 of file OSGMPBase.cpp. References osg::MPBase::_type. 00272 { 00273 return _type; 00274 }
|
|
|
Definition at line 277 of file OSGMPBase.cpp. References osg::TypeBase::getId(), and osg::MPBase::getType().
|
|
|
Definition at line 283 of file OSGMPBase.cpp. References osg::MPBase::_szName. 00284 { 00285 return _szName; 00286 }
|
|
|
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 }
|
|
|
Definition at line 69 of file OSGMemoryObject.cpp. References osg::MemoryObject::_refCount.
|
|
|
Definition at line 77 of file OSGMemoryObject.cpp. References osg::MemoryObject::_refCount. 00078 { 00079 return _refCount; 00080 }
|
|
|
Definition at line 183 of file OSGBarrier.h. Referenced by enter(), init(), and shutdown(). |
|
|
Definition at line 184 of file OSGBarrier.h. Referenced by enter(), init(), and shutdown(). |
|
|
Definition at line 185 of file OSGBarrier.h. |
|
|
Definition at line 186 of file OSGBarrier.h. |
|
|
Definition at line 86 of file OSGBarrier.h. |
|
|
Definition at line 87 of file OSGBarrier.h. Referenced by enter(), and osg::BarrierCommonBase::setNumWaitFor(). |
|
|
Reimplemented in osg::Barrier, osg::BaseThread, osg::Lock, osg::LockPool, osg::Thread, and osg::ExternalThread. Referenced by osg::MPBase::getStaticType(), and osg::MPBase::getType(). |
|
|
Definition at line 406 of file OSGMPBase.h. Referenced by osg::MPBase::getCName(), osg::LockPool::init(), osg::MPBase::MPBase(), osg::BasePThreadBase::print(), and osg::MPBase::~MPBase(). |
1.4.3