org.sape.carbon.core.util.thread |
This package provides some utilities for threading and synchronization
used by the Carbon Core Component System.
|
Java Source File Name | Type | Comment |
ReadWriteLock.java | Interface | ReadWriteLocks maintain a pair of associated locks.
The readLock may be held simultanously by multiple
reader threads, so long as there are no writers. |
ReentrantWriterPreferenceReadWriteLock.java | Class | A writer-preference ReadWriteLock that allows both readers and
writers to reacquire
read or write locks in the style of a ReentrantLock.
Readers are not allowed until all write locks held by
the writing thread have been released.
Among other applications, reentrancy can be useful when
write locks are held during calls or callbacks to methods that perform
reads under read locks.
Sample usage. |
Sync.java | Interface | Main interface for locks, gates, and conditions.
Sync objects isolate waiting and notification for particular
logical states, resource availability, events, and the like that are
shared across multiple threads. |
WriterPreferenceReadWriteLock.java | Class | A ReadWriteLock that prefers waiting writers over
waiting readers when there is contention. |