rt/emul/compact/src/main/java/java/util/concurrent/locks/package-info.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 19 Mar 2016 10:46:31 +0100
branchjdk7-b147
changeset 1890 212417b74b72
permissions -rw-r--r--
Bringing in all concurrent package from JDK7-b147
     1 /*
     2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  *
     4  * This code is free software; you can redistribute it and/or modify it
     5  * under the terms of the GNU General Public License version 2 only, as
     6  * published by the Free Software Foundation.  Oracle designates this
     7  * particular file as subject to the "Classpath" exception as provided
     8  * by Oracle in the LICENSE file that accompanied this code.
     9  *
    10  * This code is distributed in the hope that it will be useful, but WITHOUT
    11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    13  * version 2 for more details (a copy is included in the LICENSE file that
    14  * accompanied this code).
    15  *
    16  * You should have received a copy of the GNU General Public License version
    17  * 2 along with this work; if not, write to the Free Software Foundation,
    18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    19  *
    20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21  * or visit www.oracle.com if you need additional information or have any
    22  * questions.
    23  */
    24 
    25 /*
    26  * This file is available under and governed by the GNU General Public
    27  * License version 2 only, as published by the Free Software Foundation.
    28  * However, the following notice accompanied the original version of this
    29  * file:
    30  *
    31  * Written by Doug Lea with assistance from members of JCP JSR-166
    32  * Expert Group and released to the public domain, as explained at
    33  * http://creativecommons.org/publicdomain/zero/1.0/
    34  */
    35 
    36 /**
    37  * Interfaces and classes providing a framework for locking and waiting
    38  * for conditions that is distinct from built-in synchronization and
    39  * monitors.  The framework permits much greater flexibility in the use of
    40  * locks and conditions, at the expense of more awkward syntax.
    41  *
    42  * <p>The {@link java.util.concurrent.locks.Lock} interface supports
    43  * locking disciplines that differ in semantics (reentrant, fair, etc),
    44  * and that can be used in non-block-structured contexts including
    45  * hand-over-hand and lock reordering algorithms.  The main implementation
    46  * is {@link java.util.concurrent.locks.ReentrantLock}.
    47  *
    48  * <p>The {@link java.util.concurrent.locks.ReadWriteLock} interface
    49  * similarly defines locks that may be shared among readers but are
    50  * exclusive to writers.  Only a single implementation, {@link
    51  * java.util.concurrent.locks.ReentrantReadWriteLock}, is provided, since
    52  * it covers most standard usage contexts.  But programmers may create
    53  * their own implementations to cover nonstandard requirements.
    54  *
    55  * <p>The {@link java.util.concurrent.locks.Condition} interface
    56  * describes condition variables that may be associated with Locks.
    57  * These are similar in usage to the implicit monitors accessed using
    58  * {@code Object.wait}, but offer extended capabilities.
    59  * In particular, multiple {@code Condition} objects may be associated
    60  * with a single {@code Lock}.  To avoid compatibility issues, the
    61  * names of {@code Condition} methods are different from the
    62  * corresponding {@code Object} versions.
    63  *
    64  * <p>The {@link java.util.concurrent.locks.AbstractQueuedSynchronizer}
    65  * class serves as a useful superclass for defining locks and other
    66  * synchronizers that rely on queuing blocked threads.  The {@link
    67  * java.util.concurrent.locks.AbstractQueuedLongSynchronizer} class
    68  * provides the same functionality but extends support to 64 bits of
    69  * synchronization state.  Both extend class {@link
    70  * java.util.concurrent.locks.AbstractOwnableSynchronizer}, a simple
    71  * class that helps record the thread currently holding exclusive
    72  * synchronization.  The {@link java.util.concurrent.locks.LockSupport}
    73  * class provides lower-level blocking and unblocking support that is
    74  * useful for those developers implementing their own customized lock
    75  * classes.
    76  *
    77  * @since 1.5
    78  */
    79 package java.util.concurrent.locks;