ThreadPool.BindHandle 方法

定义

将操作系统句柄绑定到 ThreadPool

重载

BindHandle(IntPtr)
已过时.
已过时.

将操作系统句柄绑定到 ThreadPool

BindHandle(SafeHandle)

将操作系统句柄绑定到 ThreadPool

BindHandle(IntPtr)

Source:
ThreadPool.Portable.Unix.cs
Source:
ThreadPool.Unix.cs
Source:
ThreadPool.Unix.cs

注意

ThreadPool.BindHandle(IntPtr) has been deprecated. Please use ThreadPool.BindHandle(SafeHandle) instead.

注意

ThreadPool.BindHandle(IntPtr) has been deprecated. Use ThreadPool.BindHandle(SafeHandle) instead.

将操作系统句柄绑定到 ThreadPool

public:
 static bool BindHandle(IntPtr osHandle);
[System.Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated.  Please use ThreadPool.BindHandle(SafeHandle) instead.", false)]
public static bool BindHandle (IntPtr osHandle);
[System.Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated. Use ThreadPool.BindHandle(SafeHandle) instead.")]
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static bool BindHandle (IntPtr osHandle);
public static bool BindHandle (IntPtr osHandle);
[<System.Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated.  Please use ThreadPool.BindHandle(SafeHandle) instead.", false)>]
static member BindHandle : nativeint -> bool
[<System.Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated. Use ThreadPool.BindHandle(SafeHandle) instead.")>]
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member BindHandle : nativeint -> bool
static member BindHandle : nativeint -> bool
Public Shared Function BindHandle (osHandle As IntPtr) As Boolean

参数

osHandle
IntPtr

nativeint

持有句柄的 IntPtr。 在非托管端必须为重叠 I/O 打开该句柄。

返回

如果绑定了句柄,则为 true;否则为 false

属性

例外

调用方没有所要求的权限。

注解

将 Windows 线程池配置为使用 而不是 .NET 线程池时,不支持此方法。 有关详细信息,请参阅 Windows 线程池配置设置。 另一种选择是 ThreadPoolBoundHandle 类。

适用于

BindHandle(SafeHandle)

Source:
ThreadPool.Portable.Unix.cs
Source:
ThreadPool.Unix.cs
Source:
ThreadPool.Unix.cs

将操作系统句柄绑定到 ThreadPool

public:
 static bool BindHandle(System::Runtime::InteropServices::SafeHandle ^ osHandle);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static bool BindHandle (System.Runtime.InteropServices.SafeHandle osHandle);
[System.Security.SecurityCritical]
public static bool BindHandle (System.Runtime.InteropServices.SafeHandle osHandle);
public static bool BindHandle (System.Runtime.InteropServices.SafeHandle osHandle);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member BindHandle : System.Runtime.InteropServices.SafeHandle -> bool
[<System.Security.SecurityCritical>]
static member BindHandle : System.Runtime.InteropServices.SafeHandle -> bool
static member BindHandle : System.Runtime.InteropServices.SafeHandle -> bool
Public Shared Function BindHandle (osHandle As SafeHandle) As Boolean

参数

osHandle
SafeHandle

保存操作系统句柄的 SafeHandle。 在非托管端必须为重叠 I/O 打开该句柄。

返回

如果绑定了句柄,则为 true;否则为 false

属性

例外

osHandlenull

注解

将 Windows 线程池配置为使用 而不是 .NET 线程池时,不支持此方法。 有关详细信息,请参阅 Windows 线程池配置设置。 另一种选择是 ThreadPoolBoundHandle 类。

参数 osHandle 应为 SafeFileHandle,它派生自抽象 SafeHandle 类。

适用于