Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


AtomicReference<V>java.util.concurrent.atomic

Java 5.0serializable

This
threadsafe class holds a mutable reference to an object of type
V, provides volatile
access semantics, and defines atomic operations for manipulating that
value. get( ) and set( ) are
ordinary accessor methods for the reference. compareAndSet(
), weakCompareAndSet( ), and
getAndSet( ) perform the two named operations
atomically. compareAndSet( ) is the canonical
atomic operation: the reference is compared to an expected value,
and, if it matches, is set to a new value. compareAndSet(
) returns true if it set the value or
false otherwise. weakCompareAndSet(
) is similar but may fail to set the reference even if it
does match the expected value (it is guaranteed to succeed eventually
if the operation is repeatedly retried, however).


Figure 16-102. java.util.concurrent.atomic.AtomicReference<V>

public class

AtomicReference<V> implements Serializable {
// Public Constructors
public

AtomicReference ( );
public

AtomicReference (V

initialValue );
// Public Instance Methods
public final boolean

compareAndSet (V

expect , V

update );
public final V

get ( );
public final V

getAndSet (V

newValue );
public final void

set (V

newValue );
public final boolean

weakCompareAndSet (V

expect , V

update );
// Public Methods Overriding Object
public String

toString ( );
}



    / 1191