ThreadPoolBoundHandle.BindHandle(SafeHandle) Method

Definition

Returns a ThreadPoolBoundHandle for the specified handle, which is bound to the system thread pool.

C#
public static System.Threading.ThreadPoolBoundHandle BindHandle(System.Runtime.InteropServices.SafeHandle handle);
C#
[System.Security.SecurityCritical]
public static System.Threading.ThreadPoolBoundHandle BindHandle(System.Runtime.InteropServices.SafeHandle handle);

Parameters

handle
SafeHandle

An object that holds the operating system handle. The handle must have been opened for overlapped I/O in unmanaged code.

Returns

A ThreadPoolBoundHandle for handle, which is bound to the system thread pool.

Attributes

Exceptions

handle is null.

handle has been disposed.

-or-

handle does not refer to a valid I/O handle.

-or-

handle refers to a handle that has not been opened for overlapped I/O.

-or-

handle refers to a handle that has already been bound.

Remarks

This method should be called once per handle.

The ThreadPoolBoundHandle object does not take ownership of handle; it remains the responsibility of the caller to call Dispose.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0