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