Redigera

Dela via


ThreadPool.BindHandle Method

Definition

Binds an operating system handle to the ThreadPool.

Overloads

BindHandle(IntPtr)
Obsolete.
Obsolete.

Binds an operating system handle to the ThreadPool.

BindHandle(SafeHandle)

Binds an operating system handle to the ThreadPool.

BindHandle(IntPtr)

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

Caution

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

Caution

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

Binds an operating system handle to the 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

Parameters

osHandle
IntPtr

nativeint

An IntPtr that holds the handle. The handle must have been opened for overlapped I/O on the unmanaged side.

Returns

true if the handle is bound; otherwise, false.

Attributes

Exceptions

The caller does not have the required permission.

Remarks

This method is not supported when the Windows thread pool is configured to be used instead of the .NET thread pool. For more information, see the Windows thread pool config setting. An alternative is the ThreadPoolBoundHandle class.

Applies to

BindHandle(SafeHandle)

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

Binds an operating system handle to the 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

Parameters

osHandle
SafeHandle

A SafeHandle that holds the operating system handle. The handle must have been opened for overlapped I/O on the unmanaged side.

Returns

true if the handle is bound; otherwise, false.

Attributes

Exceptions

osHandle is null.

Remarks

This method is not supported when the Windows thread pool is configured to be used instead of the .NET thread pool. For more information, see the Windows thread pool config setting. An alternative is the ThreadPoolBoundHandle class.

The osHandle parameter should be a SafeFileHandle, which derives from the abstract SafeHandle class.

Applies to