internal CustomSocketAsyncEventArgs( Func <SocketAsyncEventArgs, TResult> endCallback, Action <SocketAsyncEventArgs> cancelCallback, CancellationToken cancellationToken) { EndCallback = endCallback; CancelCallback = cancelCallback; CancellationToken = cancellationToken; TaskHandle = CreateTaskHandle <TResult>(); }
public bool TryExtract(out TArg arg, out ValueTaskHandle <TResult> taskHandle, out CancellationToken cancellationToken) { var content = Interlocked.Exchange(ref _content, null); if (content != null) { content.Return(out arg, out taskHandle, out cancellationToken); return(true); } else { (arg, taskHandle, cancellationToken) = (default !, default, default);
internal Lending(LendingData data, ValueTaskHandle <Unit> disposedTaskHandle) { _data = data; _disposedTaskHandle = disposedTaskHandle; }
internal Entry(TArg arg, ValueTaskHandle <TResult> taskHandle, CancellationToken cancellationToken) { _content = new Content(arg, taskHandle, cancellationToken.Register(OnCanceled, this)); }