Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
MutexLockBase Class Reference#include <MutexLock.h>
Inheritance diagram for MutexLockBase:
![]() Detailed DescriptionThe main purpose of this base class is actually to allow setting of usleep_granularity across all locks.It would be nice if we just put functions in here so we could reference locks without regard to the number of doors, but then all processes which use the lock would have to have been created via fork to handle virtual calls properly, and I don't want to put that overhead on the otherwise lightweight SoundPlay process under Aperios. Definition at line 36 of file MutexLock.h.
Constructor & Destructor Documentation
Member Function Documentation
sets the SemaphoreManager which will hand out semaphores for any and all locks see preallocated for an explanation of why this function does what it does Definition at line 56 of file MutexLock.h.
this should be called if a fork() is about to occur (need to pass notification on to preallocated)
Definition at line 70 of file MutexLock.h.
Member Data Documentation
marks as unlocked
Definition at line 40 of file MutexLock.h. Referenced by MutexLock< MAX_ACCESS >::get_lock_level(), WorldStatePool::isComplete(), MutexLock< MAX_ACCESS >::releaseAll(), MutexLock< MAX_ACCESS >::unlock(), and MutexLock< MAX_ACCESS >::~MutexLock().
the estimated cost in microseconds of usleep call itself -- value passed to usleep will be 10 times this (only used by software lock implementation on non-Aperios)
Definition at line 41 of file MutexLock.h. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
the global semaphore manager object for all locks, may point to preallocated during process initialization or destruction
Definition at line 76 of file MutexLock.h.
if a semaphore needs to be reserved, and semgr is NULL, use preallocated's current value and increment it Here's the conundrum: each shared region needs a lock, each lock needs an ID from the semaphore manager, and the semaphore manager needs to be in a shared region to coordinate handing out IDs. So this is resolved by having the locks check semgr to see if it is initialized yet, and use this if it is not. Then, when the SemaphoreManager is assigned, we will copy over preallocated IDs from here For reference, only MutexLock needs to worry about this because it's the only thing that's going to need an ID before the manager is created. Definition at line 90 of file MutexLock.h.
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:34 2007 by Doxygen 1.5.4 |