#include <fxmitmutex.hh>

Public Member Functions | |
| readwritelock (int Maxuse=-1) | |
| virtual | ~readwritelock () |
| readwritelock (const readwritelock &rw) | |
| readwritelock & | operator= (const readwritelock &rw) |
| virtual void | readlock () |
| virtual void | writelock () |
| virtual void | lock () |
| virtual void | unlock () |
| bool | trylock (locktype lck=rdlock) |
brief Class to store a read/write lock.
| framexmit::readwritelock::readwritelock | ( | int | Maxuse = -1 |
) | [inline, explicit] |
Constructs a read/write lock. Takes the maxumum number of concurrent read locks as argument; a number equal or less zero represents unlimited read access. brief Default constructor.
| Maxuse | maximum number of readers |
| virtual framexmit::readwritelock::~readwritelock | ( | ) | [virtual] |
Destructs the read/write lock. brief Default destructor.
| framexmit::readwritelock::readwritelock | ( | const readwritelock & | rw | ) | [inline] |
Constructs a read/write lock, overwritting the default copy constructor by creating a new read/write lock. brief Copy constructor.
| readwritelock& framexmit::readwritelock::operator= | ( | const readwritelock & | rw | ) | [inline] |
Overrides the default assignment behaviour. Does nothing. brief Assignment operator.
| rw | readwritelock copy argument |
| virtual void framexmit::readwritelock::readlock | ( | ) | [virtual] |
Locks the lock for read. Multiple read locks (up to maxuse) can be granted, but only one write lock at any given time. If a write lock is requested while the lock is given to one or more readers, no further read locks will be granted to prevent the write task from starvation. (Write locks have absolute priority.) brief Read/write-lock lock function.
Implements framexmit::abstractsemaphore.
| virtual void framexmit::readwritelock::writelock | ( | ) | [virtual] |
Locks the lock for write. Multiple read locks (up to maxuse) can be granted, but only one write lock at any given time. If a write lock is requested while the lock is given to one or more readers, no further read locks will be granted to prevent the write task from starvation. (Write locks have absolute priority.) brief Read/write-lock lock function.
Implements framexmit::abstractsemaphore.
| virtual void framexmit::readwritelock::lock | ( | ) | [inline, virtual] |
Locks the lock for read; same as readlock(). brief Read/write-lock lock function.
Implements framexmit::abstractsemaphore.
| virtual void framexmit::readwritelock::unlock | ( | ) | [virtual] |
Unlocks the read/write lock. brief Read/write-lock unlock function.
Implements framexmit::abstractsemaphore.
| bool framexmit::readwritelock::trylock | ( | locktype | lck = rdlock |
) | [virtual] |
Trys to lock the read/write lock. To return true and locked, either a writer attemps to lock a free lock, or a reader attemps to obtain a lock which is not owned by a writer. Otherwise the function returns false and without the lock.
brief Read/write-lock trylock function.
| lck | Lock type (rdlock/wrlock) |
Implements framexmit::abstractsemaphore.
1.5.4