System::Threading::Interlocked 类
Interlocked class
提供线程安全操作的 API。这是一个没有实例服务的静态类型。无论何种方式都不应创建其实例。
class Interlocked
方法
| 方法 | 描述 |
|---|---|
| static Add(int32_t&, int32_t) | 原子递增值。 |
| static Add(int64_t&, int64_t) | 原子递增值。 |
| static CompareExchange(T&, T, T) | 比较交换变量的值:检查变量是否等于特定值,仅在已存储的值匹配预期时才存储新值。 |
| static CompareExchange(T&, T, T) | 比较交换变量的值:检查变量是否等于特定值,仅在已存储的值匹配预期时才存储新值。未实现。 |
| static CompareExchange(int32_t&, int32_t, int32_t, bool&) | 比较交换变量的值:检查变量是否等于特定值,仅在已存储的值匹配预期时才存储新值。 |
| static Decrement(int32_t&) | 原子递减值。 |
| static Decrement(int64_t&) | 原子递减值。 |
| static Exchange(T&, T) | 交换变量的值:存储新值并返回存储前变量原有的值。 |
| static Exchange(T&, T) | 交换变量的值:存储新值并返回存储前变量原有的值。未实现。 |
| static ExchangeAdd(int32_t&, int32_t) | 通过 exchange-add 过程原子递增值。 |
| static ExchangeAdd(int64_t&, int64_t) | 通过 exchange-add 过程原子递增值。 |
| static Increment(int32_t&) | 原子递增值。 |
| static Increment(int64_t&) | 原子递增值。 |
| static Read(int64_t&) | 返回一个 64 位值,以原子操作加载。 |
另见
- Namespace System::Threading
- Library Aspose.Font for C++