Thread.VolatileRead 方法

定义

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

重载

VolatileRead(SByte)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(Single)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(UInt64)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(UInt32)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(Object)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(UIntPtr)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(UInt16)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(Int64)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(IntPtr)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(Int16)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(Double)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(Byte)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(Int32)
已过时.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

VolatileRead(SByte)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

重要

此 API 不符合 CLS。

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
[System.CLSCompliant(false)]
public static sbyte VolatileRead(ref sbyte address);
C#
[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static sbyte VolatileRead(ref sbyte address);

参数

address
SByte

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已被 和 Volatile.Write取代Volatile.Read。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(Single)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static float VolatileRead(ref float address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static float VolatileRead(ref float address);

参数

address
Single

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已被 和 Volatile.Write取代Volatile.Read。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(UInt64)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

重要

此 API 不符合 CLS。

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
[System.CLSCompliant(false)]
public static ulong VolatileRead(ref ulong address);
C#
[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static ulong VolatileRead(ref ulong address);

参数

address
UInt64

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已被 和 Volatile.Write取代Volatile.Read。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(UInt32)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

重要

此 API 不符合 CLS。

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
[System.CLSCompliant(false)]
public static uint VolatileRead(ref uint address);
C#
[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static uint VolatileRead(ref uint address);

参数

address
UInt32

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已被 和 Volatile.Write取代Volatile.Read。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(Object)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static object? VolatileRead(ref object? address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static object? VolatileRead(ref object? address);
C#
public static object VolatileRead(ref object address);

参数

address
Object

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已被 和 Volatile.Write取代Volatile.Read。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(UIntPtr)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

重要

此 API 不符合 CLS。

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
[System.CLSCompliant(false)]
public static UIntPtr VolatileRead(ref UIntPtr address);
C#
[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static UIntPtr VolatileRead(ref UIntPtr address);

参数

address
UIntPtr

要读取的字段。

返回

UIntPtr

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已被 和 Volatile.Write取代Volatile.Read。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(UInt16)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

重要

此 API 不符合 CLS。

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
[System.CLSCompliant(false)]
public static ushort VolatileRead(ref ushort address);
C#
[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static ushort VolatileRead(ref ushort address);

参数

address
UInt16

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已被 和 Volatile.Write取代Volatile.Read。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(Int64)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static long VolatileRead(ref long address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static long VolatileRead(ref long address);

参数

address
Int64

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已替换为 Volatile.ReadVolatile.Write。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(IntPtr)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static IntPtr VolatileRead(ref IntPtr address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static IntPtr VolatileRead(ref IntPtr address);

参数

address
IntPtr

要读取的字段。

返回

IntPtr

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已替换为 Volatile.ReadVolatile.Write。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(Int16)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static short VolatileRead(ref short address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static short VolatileRead(ref short address);

参数

address
Int16

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已替换为 Volatile.ReadVolatile.Write。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(Double)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static double VolatileRead(ref double address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static double VolatileRead(ref double address);

参数

address
Double

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已替换为 Volatile.ReadVolatile.Write。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(Byte)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static byte VolatileRead(ref byte address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static byte VolatileRead(ref byte address);

参数

address
Byte

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已替换为 Volatile.ReadVolatile.Write。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileRead(Int32)

Source:
Thread.cs
Source:
Thread.cs
Source:
Thread.cs

注意

Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.

读取字段值。 在需要进行此操作的系统上,插入防止处理器重新对内存操作进行排序的内存屏障,如下所示:如果读取或写入操作在代码中出现在此方法之后,则处理器无法将其移至此方法之前。

C#
public static int VolatileRead(ref int address);
C#
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static int VolatileRead(ref int address);

参数

address
Int32

要读取的字段。

返回

读取的值。

属性

注解

Thread.VolatileReadThread.VolatileWrite 是旧 API,已替换为 Volatile.ReadVolatile.Write。 有关更多信息,请参见 Volatile 类。

适用于

.NET 9 和其他版本
产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1