CancellationTokenRegistration 구조체
정의
CancellationToken에 등록된 콜백 대리자를 나타냅니다.Represents a callback delegate that has been registered with a CancellationToken.
public value class CancellationTokenRegistration : IDisposable, IEquatable<System::Threading::CancellationTokenRegistration>
public value class CancellationTokenRegistration : IAsyncDisposable, IDisposable, IEquatable<System::Threading::CancellationTokenRegistration>
public struct CancellationTokenRegistration : IDisposable, IEquatable<System.Threading.CancellationTokenRegistration>
public struct CancellationTokenRegistration : IAsyncDisposable, IDisposable, IEquatable<System.Threading.CancellationTokenRegistration>
type CancellationTokenRegistration = struct
interface IDisposable
type CancellationTokenRegistration = struct
interface IAsyncDisposable
interface IDisposable
Public Structure CancellationTokenRegistration
Implements IDisposable, IEquatable(Of CancellationTokenRegistration)
Public Structure CancellationTokenRegistration
Implements IAsyncDisposable, IDisposable, IEquatable(Of CancellationTokenRegistration)
- 상속
- 구현
설명
콜백은 토큰이 취소 될 때 호출 됩니다.The callback is called when the token is canceled. 콜백의 등록을 취소 하려면 해당 등록 인스턴스를 삭제 합니다.To unregister a callback, dispose the corresponding Registration instance. 자세한 내용 및 코드 예제 는 관리 되는 스레드의 취소를 참조 하세요.For more information and code examples see Cancellation in Managed Threads.
속성
Token |
이 등록과 연결된 CancellationToken을 가져옵니다.Gets the CancellationToken with which this registration is associated. |
메서드
Dispose() |
CancellationTokenRegistration 클래스의 현재 인스턴스에서 사용하는 모든 리소스를 해제합니다.Releases all resources used by the current instance of the CancellationTokenRegistration class. |
DisposeAsync() |
등록 삭제하고 연결된 CancellationToken에서 대상 콜백을 등록 취소합니다.Disposes of the registration and unregisters the target callback from the associated CancellationToken. |
Equals(CancellationTokenRegistration) |
현재 CancellationTokenRegistration 인스턴스와 지정한 CancellationTokenRegistration가 같은지 여부를 확인합니다.Determines whether the current CancellationTokenRegistration instance is equal to the specified CancellationTokenRegistration. |
Equals(Object) |
현재 CancellationTokenRegistration 인스턴스와 지정한 CancellationTokenRegistration가 같은지 여부를 확인합니다.Determines whether the current CancellationTokenRegistration instance is equal to the specified CancellationTokenRegistration. |
GetHashCode() |
CancellationTokenRegistration의 해시 함수 역할을 수행합니다.Serves as a hash function for a CancellationTokenRegistration. |
Unregister() |
등록 삭제하고 연결된 CancellationToken에서 대상 콜백을 등록 취소합니다.Disposes of the registration and unregisters the target callback from the associated CancellationToken. |
연산자
Equality(CancellationTokenRegistration, CancellationTokenRegistration) |
두 개의 CancellationTokenRegistration 인스턴스가 같은지 여부를 확인합니다.Determines whether two CancellationTokenRegistration instances are equal. |
Inequality(CancellationTokenRegistration, CancellationTokenRegistration) |
두 CancellationTokenRegistration 인스턴스가 서로 다른지 여부를 확인합니다.Determines whether two CancellationTokenRegistration instances are not equal. |
확장 메서드
ConfigureAwait(IAsyncDisposable, Boolean) |
비동기 일회용에서 반환되는 작업을 대기하는 방법을 구성합니다.Configures how awaits on the tasks returned from an async disposable are performed. |
적용 대상
스레드 보안
의 모든 public 및 protected 멤버 CancellationTokenRegistration 는 스레드로부터 안전 하며 여러 스레드에서 동시에 사용 될 수 있습니다. Dispose는 예외입니다. Dispose는의 다른 모든 작업이 완료 된 경우에만 사용 해야 합니다 CancellationTokenRegistration .All public and protected members of CancellationTokenRegistration are thread-safe and may be used concurrently from multiple threads, with the exception of Dispose, which must only be used when all other operations on the CancellationTokenRegistration have completed.