Package java. util. concurrent. locks
See: Description
-
Interface Summary Interface Description Condition Lock Lock
implementations provide more extensive locking operations than can be obtained usingsynchronized
methods and statements.ReadWriteLock A ReadWriteLock maintains a pair of associatedlocks
, one for read-only operations and one for writing. -
Class Summary Class Description AbstractOwnableSynchronizer A synchronizer that may be exclusively owned by a thread.AbstractQueuedLongSynchronizer A version ofAbstractQueuedSynchronizer
in which synchronization state is maintained as a long.AbstractQueuedSynchronizer Provides a framework for implementing blocking locks and related synchronizers (semaphores, events, etc) that rely on first-in-first-out (FIFO) wait queues.LockSupport Basic thread blocking primitives for creating locks and other synchronization classes.ReentrantLock A reentrant mutual exclusionLock
with the same basic behavior and semantics as the implicit monitor lock accessed usingsynchronized
methods and statements, but with extended capabilities.ReentrantReadWriteLock An implementation ofReadWriteLock
supporting similar semantics toReentrantLock
.ReentrantReadWriteLock.ReadLock The lock returned by methodReentrantReadWriteLock.readLock()
.ReentrantReadWriteLock.WriteLock The lock returned by methodReentrantReadWriteLock.writeLock()
.
Package java.util.concurrent.locks Description
The Lock
interface supports
locking disciplines that differ in semantics (reentrant, fair, etc),
and that can be used in non-block-structured contexts including
hand-over-hand and lock reordering algorithms. The main implementation
is ReentrantLock
.
The ReadWriteLock
interface
similarly defines locks that may be shared among readers but are
exclusive to writers. Only a single implementation, ReentrantReadWriteLock
, is provided, since
it covers most standard usage contexts. But programmers may create
their own implementations to cover nonstandard requirements.
The Condition
interface
describes condition variables that may be associated with Locks.
These are similar in usage to the implicit monitors accessed using
Object.wait
, but offer extended capabilities.
In particular, multiple Condition
objects may be associated
with a single Lock
. To avoid compatibility issues, the
names of Condition
methods are different from the
corresponding Object
versions.
The AbstractQueuedSynchronizer
class serves as a useful superclass for defining locks and other
synchronizers that rely on queuing blocked threads. The AbstractQueuedLongSynchronizer
class
provides the same functionality but extends support to 64 bits of
synchronization state. Both extend class AbstractOwnableSynchronizer
, a simple
class that helps record the thread currently holding exclusive
synchronization. The LockSupport
class provides lower-level blocking and unblocking support that is
useful for those developers implementing their own customized lock
classes.
- Since:
- 1.5
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/12/2024 04:11:22 Cette version de la page est en cache (à la date du 22/12/2024 04:11:22) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/10/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/util/concurrent/locks/package-summary.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.