AtomicBoolean.CompareAndExchangeRelease(Boolean, Boolean) 方法

定义

以原子方式将值设置为 newValue 当前值(称为 <em>见证值</em>)时, == expectedValue其内存效果由指定 VarHandle#compareAndExchangeRelease

[Android.Runtime.Register("compareAndExchangeRelease", "(ZZ)Z", "", ApiSince=33)]
public bool CompareAndExchangeRelease(bool expectedValue, bool newValue);
[<Android.Runtime.Register("compareAndExchangeRelease", "(ZZ)Z", "", ApiSince=33)>]
member this.CompareAndExchangeRelease : bool * bool -> bool

参数

expectedValue
Boolean

预期值

newValue
Boolean

新值

返回

<em>见证值</em>,如果成功,它将与预期值相同

属性

注解

以原子方式将值设置为 newValue 当前值(称为 <em>见证值</em>)时, == expectedValue其内存效果由指定 VarHandle#compareAndExchangeRelease

已在 9 中添加。

Java文档java.util.concurrent.atomic.AtomicBoolean.compareAndExchangeRelease(boolean, boolean)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于