static class · System.Threading

Interlocked

public static class Interlocked

Atomic operations on numbers in memory reached by pointers (unsafe code): Interlocked.Add(&counts[i], 1).

Tipo
static class
Espacio de nombres
System.Threading
Ensamblado
System.Core
Acceso
public, static, abstract
Archivo fuente
Threading.ant

Herencia

Clases base
Any Interlocked

Métodos

unsafe Add(i64* location, i64 value) : i64
#

static

unsafe Add(i32* location, i32 value) : i32
#

static

unsafe Increment(i64* location) : i64
#

static

unsafe Increment(i32* location) : i32
#

static

unsafe Decrement(i64* location) : i64
#

static

unsafe Decrement(i32* location) : i32
#

static

unsafe Exchange(i64* location, i64 value) : i64
#

static

unsafe Exchange(i32* location, i32 value) : i32
#

static

unsafe CompareExchange(i64* location, i64 value, i64 comparand) : i64
#

static

unsafe CompareExchange(i32* location, i32 value, i32 comparand) : i32
#

static

unsafe Read(i64* location) : i64
#

static

Miembros privados e internos (7)

unsafe extern("atomic.add.i64") AddAt64(i64* at, i64 value) : i64
#

private static

unsafe extern("atomic.xchg.i64") ExchangeAt64(i64* at, i64 value) : i64
#

private static

unsafe extern("atomic.cas.i64") CompareAt64(i64* at, i64 expected, i64 value) : i64
#

private static

unsafe extern("atomic.load.i64") LoadAt64(i64* at) : i64
#

private static

unsafe extern("atomic.add.i32") AddAt32(i32* at, i32 value) : i32
#

private static

unsafe extern("atomic.xchg.i32") ExchangeAt32(i32* at, i32 value) : i32
#

private static

unsafe extern("atomic.cas.i32") CompareAt32(i32* at, i32 expected, i32 value) : i32
#

private static

Miembros heredados (5)

Código fuente

Interlocked en Antril, descompilado a partir de su Larva HIR.

System.Threading.Interlocked.ant
// System.Threading.Interlocked — System.Core (decompiled from Larva HIR)

into namespace System.Threading
{
	/// Atomic operations on numbers in memory reached by pointers (unsafe code): `Interlocked.Add(&counts[i], 1)`.
	public static class Interlocked
	{
		unsafe extern("atomic.add.i64") AddAt64(i64* at, i64 value) : i64;

		unsafe extern("atomic.xchg.i64") ExchangeAt64(i64* at, i64 value) : i64;

		unsafe extern("atomic.cas.i64") CompareAt64(i64* at, i64 expected, i64 value) : i64;

		unsafe extern("atomic.load.i64") LoadAt64(i64* at) : i64;

		unsafe extern("atomic.add.i32") AddAt32(i32* at, i32 value) : i32;

		unsafe extern("atomic.xchg.i32") ExchangeAt32(i32* at, i32 value) : i32;

		unsafe extern("atomic.cas.i32") CompareAt32(i32* at, i32 expected, i32 value) : i32;

		public:
			unsafe Add(i64* location, i64 value) : i64 => AddAt64(location, value) + value;

			unsafe Add(i32* location, i32 value) : i32 => AddAt32(location, value) + value;

			unsafe Increment(i64* location) : i64 => AddAt64(location, 1) + 1;

			unsafe Increment(i32* location) : i32 => AddAt32(location, 1) + 1;

			unsafe Decrement(i64* location) : i64 => AddAt64(location, -1) - 1;

			unsafe Decrement(i32* location) : i32 => AddAt32(location, -1) - 1;

			unsafe Exchange(i64* location, i64 value) : i64 => ExchangeAt64(location, value);

			unsafe Exchange(i32* location, i32 value) : i32 => ExchangeAt32(location, value);

			unsafe CompareExchange(i64* location, i64 value, i64 comparand) : i64 => CompareAt64(location, comparand, value);

			unsafe CompareExchange(i32* location, i32 value, i32 comparand) : i32 => CompareAt32(location, comparand, value);

			unsafe Read(i64* location) : i64 => LoadAt64(location);
	}
}
Esc