language/duchain
KDevelop::DUChainLock Class Reference
Customized read/write locker for the definition-use chain. More...
#include <duchainlock.h>
Public Member Functions | |
| DUChainLock () | |
| ~DUChainLock () | |
| bool | currentThreadHasReadLock () |
| bool | currentThreadHasWriteLock () |
| bool | lockForRead () |
| bool | lockForRead (unsigned int timeout) |
| bool | lockForWrite (uint timeout=0) |
| void | releaseReadLock () |
| void | releaseWriteLock () |
Detailed Description
Customized read/write locker for the definition-use chain.
Definition at line 47 of file duchainlock.h.
Constructor & Destructor Documentation
| KDevelop::DUChainLock::DUChainLock | ( | ) |
Constructor.
Definition at line 160 of file duchainlock.cpp.
| KDevelop::DUChainLock::~DUChainLock | ( | ) |
Destructor.
Definition at line 165 of file duchainlock.cpp.
Member Function Documentation
| bool KDevelop::DUChainLock::currentThreadHasReadLock | ( | ) |
Determines if the current thread has a read lock.
Definition at line 262 of file duchainlock.cpp.
| bool KDevelop::DUChainLock::currentThreadHasWriteLock | ( | ) |
Determines if the current thread has a write lock.
Definition at line 341 of file duchainlock.cpp.
| bool KDevelop::DUChainLock::lockForRead | ( | ) |
Acquires a read lock.
Will not return until the lock is acquired or timeout of 10 seconds is reached.
Any number of read locks can be acquired at once, but not while there is a write lock. Read locks are recursive. That means that a thread can acquire a read-lock when it already has an arbitrary count of read- and write-locks acquired.
Definition at line 228 of file duchainlock.cpp.
| bool KDevelop::DUChainLock::lockForRead | ( | unsigned int | timeout | ) |
Acquires a read lock.
Will not return until the lock is acquired or timeout
Any number of read locks can be acquired at once, but not while there is a write lock. Read locks are recursive. That means that a thread can acquire a read-lock when it already has an arbitrary count of read- and write-locks acquired.
- Parameters:
-
timeout A locking timeout in milliseconds. If it is reached, and the lock could not be acquired, false is returned. If null, the default timeout is used.
Definition at line 174 of file duchainlock.cpp.
| bool KDevelop::DUChainLock::lockForWrite | ( | uint | timeout = 0 |
) |
Acquires a write lock.
Will not return until the lock is acquired or timeout is reached (10 seconds).
Write locks are recursive. That means that they can by acquired by threads that already have an arbitrary count of write-locks acquired.
- Parameters:
-
timeout A timeout in milliseconds. If zero, the default-timeout is used(Currently 10 seconds).
- Warning:
- Write-locks can NOT be acquired by threads that already have a read-lock.
Definition at line 275 of file duchainlock.cpp.
| void KDevelop::DUChainLock::releaseReadLock | ( | ) |
Releases a previously acquired read lock.
- Todo:
- Remove the all readers that do not exist any more at some point(leave other readers there with recursion 0 because it is very probable that they will lock again, and not having to re-allocate the bucket might speed up the locking.
Definition at line 234 of file duchainlock.cpp.
| void KDevelop::DUChainLock::releaseWriteLock | ( | ) |
Releases a previously acquired write lock.
Definition at line 321 of file duchainlock.cpp.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference